]> andersk Git - moira.git/blobdiff - lib/hash.c
Fix another freeing-memory-we-didn't-malloc bug in AddMachine. This
[moira.git] / lib / hash.c
index d09615c1543e56915e00db057b1b241d20b5dd7c..665925d4077759ed2b0db156b14c7714b8c6724f 100644 (file)
 #include <mit-copyright.h>
 #include <ctype.h>
 #include <moira.h>
+#include <string.h>
+#include <stdlib.h>
 
-extern char *malloc();
-
+#ifndef NULL
 #define NULL 0
+#endif
 #define hash_func(h, key) (key >= 0 ? (key % h->size) : (-key % h->size))
 
 /* Create a hash table.  The size is just a hint, not a maximum. */
@@ -32,7 +34,7 @@ int size;
        free(h);
        return((struct hash *) NULL);
     }
-    bzero(h->data, size * sizeof(char *));
+    memset(h->data, 0, size * sizeof(char *));
     return(h);
 }
 
This page took 0.092713 seconds and 4 git commands to generate.