Mercurial > dropbear
diff random.c @ 298:7dad470ad4aa
minor cleanups for some warnings
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 22 Mar 2006 05:12:18 +0000 |
parents | 3be7ae2e8dfa |
children | 1876c6bb084b 36d21680a9d3 |
line wrap: on
line diff
--- a/random.c Sat Mar 11 14:59:34 2006 +0000 +++ b/random.c Wed Mar 22 05:12:18 2006 +0000 @@ -31,7 +31,8 @@ /* this is used to generate unique output from the same hashpool */ static uint32_t counter = 0; -#define MAX_COUNTER 1<<31 /* the max value for the counter, so it won't loop */ +/* the max value for the counter, so it won't integer overflow */ +#define MAX_COUNTER 1<<30 static unsigned char hashpool[SHA1_HASH_SIZE]; @@ -167,7 +168,6 @@ gettimeofday(&tv, NULL); hash_state hs; - unsigned char hash[SHA1_HASH_SIZE]; sha1_init(&hs); sha1_process(&hs, (void*)hashpool, sizeof(hashpool)); sha1_process(&hs, (void*)&pid, sizeof(pid));