diff options
author | Rob Landley <rob@landley.net> | 2015-12-12 02:14:39 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-12-12 02:14:39 -0600 |
commit | 047bcb8e7d37847b96dbf621ea22ff00e9541d32 (patch) | |
tree | 6b4ed61e346e2f73dd0be233ee4c1862891d92fb | |
parent | aaecbbac2f94b7a93eb2df7f9db78828cbb7b647 (diff) | |
download | toybox-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.
-rw-r--r-- | toys/posix/ls.c | 1 |
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) { |