Make sure "struct timeval" is initialised on OS X to avoid valgrind warnings

This commit is contained in:
Matt Johnston 2013-03-21 21:23:34 +08:00
parent 845ad0be39
commit eaa737fecd

View File

@ -217,6 +217,9 @@ void seedrandom() {
pid = getpid();
sha1_process(&hs, (void*)&pid, sizeof(pid));
// gettimeofday() doesn't completely fill out struct timeval on
// OS X (10.8.3), avoid valgrind warnings by clearing it first
memset(&tv, 0x0, sizeof(tv));
gettimeofday(&tv, NULL);
sha1_process(&hs, (void*)&tv, sizeof(tv));