aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ls.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-12-12 02:14:39 -0600
committerRob Landley <rob@landley.net>2015-12-12 02:14:39 -0600
commit047bcb8e7d37847b96dbf621ea22ff00e9541d32 (patch)
tree6b4ed61e346e2f73dd0be233ee4c1862891d92fb /toys/posix/ls.c
parentaaecbbac2f94b7a93eb2df7f9db78828cbb7b647 (diff)
downloadtoybox-047bcb8e7d37847b96dbf621ea22ff00e9541d32.tar.gz
Add a useless memset (under CFG_TOYBOX_DEBUG) to shut up valgrind.
Valgrind complains that we add uninitalized memory to totals[] fields we never read from. (If we didn't set it in entrylen() we don't use it during display, they're testing the same flags), but valgrind doesn't understand that.
Diffstat (limited to 'toys/posix/ls.c')
-rw-r--r--toys/posix/ls.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index 04f64152..7dc85ac9 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -299,6 +299,7 @@ static void listfiles(int dirfd, struct dirtree *indir)
}
memset(totals, 0, sizeof(totals));
+ if (CFG_TOYBOX_DEBUG) memset(len, 0, sizeof(len));
// Top level directory was already populated by main()
if (!indir->parent) {