From 047bcb8e7d37847b96dbf621ea22ff00e9541d32 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 12 Dec 2015 02:14:39 -0600 Subject: 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. --- toys/posix/ls.c | 1 + 1 file changed, 1 insertion(+) (limited to 'toys/posix/ls.c') 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) { -- cgit v1.2.3