summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-04-19 20:07:25 +0000
committerJim Meyering <jim@meyering.net>2004-04-19 20:07:25 +0000
commit9b10f9414f55dfa34a5b392490ee38c7dd6e459a (patch)
tree38348ee6fb0a60ed686101d04da663f1059df7d9 /src
parentc9187f989dc9af5edd8044323ff0542cfc38d07b (diff)
downloadcoreutils-9b10f9414f55dfa34a5b392490ee38c7dd6e459a.tar.xz
(isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]:
Initialize a buffer to avoid warnings from tools like valgrind.
Diffstat (limited to 'src')
-rw-r--r--src/shred.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shred.c b/src/shred.c
index 42276771a..80415bf3d 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -466,7 +466,14 @@ isaac_seed_start (struct isaac_state *s)
#endif
for (i = 0; i < 8; i++)
s->iv[i] = iv[i];
- /* We could initialize s->mm to zero, but why bother? */
+
+ /* Enable the following memset if you're worried about used-uninitialized
+ warnings involving code in isaac_refill from tools like valgrind.
+ Since this buffer is used to accumulate pseudo-random data, there's
+ no harm, and maybe even some benefit, in using it uninitialized. */
+#if AVOID_USED_UNINITIALIZED_WARNINGS
+ memset (s->mm, 0, sizeof s->mm);
+#endif
/* s->c gets used for a data pointer during the seeding phase */
s->a = s->b = s->c = 0;