From b864c6a1e4dfc293d3b49d70a4969c1d6eb3ccc5 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Tue, 16 Jul 2002 19:31:37 +0000 Subject: [PATCH] Fixed malloc.h compile bug. svn path=/trunk/boinc/; revision=207 --- lib/crypt.C | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/crypt.C b/lib/crypt.C index 573d98a072..ce5411d633 100644 --- a/lib/crypt.C +++ b/lib/crypt.C @@ -1,5 +1,8 @@ #include +#include +#if HAVE_MALLOC_H #include +#endif #include "md5_file.h" #include "crypt.h" @@ -45,6 +48,7 @@ int sprint_hex_data(char* p, DATA_BLOCK& x) { } if (x.len%32 != 0) strcat(p, "\n"); strcat(p, ".\n"); + return 0; } @@ -190,6 +194,7 @@ int scan_key_hex(FILE* f, KEY* key, int size) { int sscan_key_hex(char* buf, KEY* key, int size) { int n, retval,num_bits; DATA_BLOCK db; + if(buf==NULL) { fprintf(stderr, "error: sscan_key_hex: unexpected NULL pointer buf\n"); return ERR_NULL; @@ -206,6 +211,7 @@ int sscan_key_hex(char* buf, KEY* key, int size) { n = sscanf(buf, "%d", &num_bits); key->bits = num_bits; //key->bits is a short //fprintf(stderr, "key->bits = %d\n", key->bits); + if (n != 1) return -1; buf = strchr(buf, '\n'); if (!buf) return -1;