Skip to content
Permalink
Browse files

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.
  • Loading branch information...
landley committed Dec 12, 2015
1 parent aaecbba commit 047bcb8e7d37847b96dbf621ea22ff00e9541d32
Showing with 1 addition and 0 deletions.
  1. +1 −0 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) {

0 comments on commit 047bcb8

Please sign in to comment.
You can’t perform that action at this time.