diff options
author | Rob Landley <rob@landley.net> | 2016-06-15 15:47:01 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-06-15 15:47:01 -0500 |
commit | 46409d50e5632b28b88cfa4991fffef9adaa490d (patch) | |
tree | 4c3347b37664b580996e4551bde023346567728b /toys/other/stat.c | |
parent | 97ddc600c95623bf803eac4f2a4deda2a2db02d4 (diff) | |
download | toybox-46409d50e5632b28b88cfa4991fffef9adaa490d.tar.gz |
Add readlink0() and readlinkat0() which null terminate the data.
Diffstat (limited to 'toys/other/stat.c')
-rw-r--r-- | toys/other/stat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/other/stat.c b/toys/other/stat.c index 9f77a600..7a6b38d7 100644 --- a/toys/other/stat.c +++ b/toys/other/stat.c @@ -110,7 +110,7 @@ static void print_stat(char type) } else if (type == 'N') { xprintf("`%s'", TT.file); if (S_ISLNK(stat->st_mode)) - if (0<readlink(TT.file, toybuf, sizeof(toybuf))) + if (readlink0(TT.file, toybuf, sizeof(toybuf))) xprintf(" -> `%s'", toybuf); } else if (type == 'o') out('u', stat->st_blksize); else if (type == 's') out('u', stat->st_size); |