summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2006-03-22 05:12:18 +0000
committerMatt Johnston <matt@ucc.asn.au>2006-03-22 05:12:18 +0000
commitdde673f8d7f2500c00c14384a17f5ee74e80431c (patch)
tree54aa337847b18df59e3232b04bb1ba5eb45b31a0
parent3f49fc5f2ca0ec4adb5cac081f502cbb86702efa (diff)
minor cleanups for some warnings
--HG-- extra : convert_revision : 6ace12c71fc2773210f2f3d374c96622ca54fe48
-rw-r--r--random.c4
-rw-r--r--svr-main.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/random.c b/random.c
index cbbe016..5953a43 100644
--- a/random.c
+++ b/random.c
@@ -31,7 +31,8 @@ static int donerandinit = 0;
/* 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 @@ void reseedrandom() {
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));
diff --git a/svr-main.c b/svr-main.c
index e06eb5e..e00de6b 100644
--- a/svr-main.c
+++ b/svr-main.c
@@ -28,6 +28,7 @@
#include "buffer.h"
#include "signkey.h"
#include "runopts.h"
+#include "random.h"
static size_t listensockets(int *sock, size_t sockcount, int *maxfd);
static void sigchld_handler(int dummy);