aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 9df04906..7ae2472f 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -1306,7 +1306,7 @@ int readlinkat0(int dirfd, char *path, char *buf, int len)
if (!len) return 0;
len = readlinkat(dirfd, path, buf, len-1);
- if (len<1) return 0;
+ if (len<0) len = 0;
buf[len] = 0;
return len;