diff options
Diffstat (limited to 'procfs/netfs.c')
-rw-r--r-- | procfs/netfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/procfs/netfs.c b/procfs/netfs.c index f68435d4..20238386 100644 --- a/procfs/netfs.c +++ b/procfs/netfs.c @@ -87,11 +87,11 @@ error_t netfs_attempt_read (struct iouser *cred, struct node *np, contents += offset; contents_len -= offset; + if (contents_len < 0) + contents_len = 0; if (*len > contents_len) *len = contents_len; - if (*len < 0) - *len = 0; memcpy (data, contents, *len); return 0; |