From e351346da584402647a147514610a744ee064d8e Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 14 Jan 2009 20:09:06 +0100 Subject: hashtable: check NULL instead of ! for pointers This patch is a cleanup. Check NULL instead of using ! for null pointers. Signed-off-by: Pablo Neira Ayuso --- src/hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hash.c b/src/hash.c index a7c7536..1edb977 100644 --- a/src/hash.c +++ b/src/hash.c @@ -31,7 +31,7 @@ struct hashtable_node *hashtable_alloc_node(int datasize, void *data) int size = sizeof(struct hashtable_node) + datasize; n = calloc(size, 1); - if (!n) + if (n == NULL) return NULL; memcpy(n->data, data, datasize); @@ -55,7 +55,7 @@ hashtable_create(int hashsize, int limit, int datasize, + hashsize * sizeof(struct slist_head); h = (struct hashtable *) calloc(size, 1); - if (!h) { + if (h == NULL) { errno = ENOMEM; return NULL; } -- cgit v1.2.3