diff options
author | Rob Landley <rob@landley.net> | 2019-05-12 13:18:58 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-05-12 13:18:58 -0500 |
commit | cf2fa2821e25e641f8b84837d395986c78e3bbea (patch) | |
tree | 3a3fda0236f2e4d57d70e0e915b7d4d13c5f2e20 | |
parent | 706477ba3d7f12b48089a0d2ac3785f7652b4ef2 (diff) | |
download | toybox-cf2fa2821e25e641f8b84837d395986c78e3bbea.tar.gz |
Fix readlink0() to blank string on failure.
-rw-r--r-- | lib/lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |