Commit Diff


commit - c7693f625e9d6c5a7c8aea7a8c8bb5c5a5378843
commit + 76604f847aef63fbf091c03b0b938cf9a89c94d9
blob - e468a1e5e871329c0796137a4981914b37cd5557
blob + 26c636a6394870d7d2aa941dbd7e46773c981cdb
--- src/ngircd/array.c
+++ src/ngircd/array.c
@@ -12,7 +12,7 @@
 
 #include "array.h"
 
-static char UNUSED id[] = "$Id: array.c,v 1.2 2005/07/07 21:26:31 fw Exp $";
+static char UNUSED id[] = "$Id: array.c,v 1.3 2005/07/11 14:10:53 fw Exp $";
 
 #include <assert.h>
 
@@ -56,7 +56,7 @@ array_alloc(array * a, unsigned int size, unsigned int
 	unsigned int aligned = 0;
 	char *tmp;
 
-	assert(size);
+	assert(size > 0);
 
 	if (pos_plus1 < pos)
 		return NULL;
@@ -110,8 +110,8 @@ array_alloc(array * a, unsigned int size, unsigned int
 unsigned int
 array_length(const array * const a, unsigned int membersize)
 {
-	assert(a);
-	assert(membersize);
+	assert(a != NULL);
+	assert(membersize > 0);
 
 	if (array_UNUSABLE(a))
 		return 0;
@@ -135,8 +135,8 @@ array_copy(array * dest, const array * const src)
 bool
 array_copyb(array * dest, const char *src, unsigned int len)
 {
-	assert(dest);
-	assert(src);
+	assert(dest != NULL);
+	assert(src != NULL );
 
 	if (!len || !src)
 		return true;
@@ -172,8 +172,8 @@ array_catb(array * dest, const char *src, unsigned int
 	unsigned int used;
 	char *ptr;
 
-	assert(dest);
-	assert(src);
+	assert(dest != NULL);
+	assert(src != NULL);
 
 	if (!len)
 		return true;
@@ -192,7 +192,7 @@ array_catb(array * dest, const char *src, unsigned int
 
 	ptr = dest->mem;
 
-	assert(ptr);
+	assert(ptr != NULL);
 
 #ifdef DEBUG
 	Log(LOG_DEBUG,
@@ -240,8 +240,8 @@ array_get(array * a, unsigned int membersize, unsigned
 {
 	unsigned int totalsize;
 
-	assert(membersize);
-	assert(a);
+	assert(membersize > 0);
+	assert(a != NULL);
 
 	if (array_UNUSABLE(a))
 		return NULL;
@@ -259,7 +259,7 @@ array_get(array * a, unsigned int membersize, unsigned
 void
 array_free(array * a)
 {
-	assert(a);
+	assert(a != NULL);
 #ifdef DEBUG
 	Log(LOG_DEBUG,
 	    "array_free: %u bytes free'd (%u bytes still used at time of free())",
@@ -285,7 +285,7 @@ array_free_wipe(array * a)
 void *
 array_start(const array * const a)
 {
-	assert(a);
+	assert(a != NULL);
 	return a->mem;
 }
 
@@ -293,7 +293,7 @@ array_start(const array * const a)
 void
 array_trunc(array * a)
 {
-	assert(a);
+	assert(a != NULL);
 	a->used = 0;
 }
 
@@ -302,7 +302,7 @@ void
 array_truncate(array * a, unsigned int membersize, unsigned int len)
 {
 	unsigned int newlen;
-	assert(a);
+	assert(a != NULL);
 	if (!safemult_uint(membersize, len, &newlen))
 		return;
 
@@ -317,8 +317,8 @@ array_moveleft(array * a, unsigned int membersize, uns
 {
 	unsigned int bytepos;
 
-	assert(a);
-	assert(membersize);
+	assert(a != NULL);
+	assert(membersize > 0);
 
 	if (!pos)
 		return;