commit - 994a003aba9aac4a8adca7f4f4fec0889b0f2bb1
commit + 23ce0393b23779f19d6d56103c46f9d929fdef53
blob - 75106f623926edb8c85cf2736d3aaf67325761a5
blob + 0fa960857dda156fe1ee8eeaf7ae8ec4040403c6
--- src/ngircd/array.c
+++ src/ngircd/array.c
#include "array.h"
-static char UNUSED id[] = "$Id: array.c,v 1.15 2007/11/18 15:05:35 alex Exp $";
-
#include <assert.h>
#include <stdlib.h>
-#define array_UNUSABLE(x) ( !(x)->mem || (0 == (x)->allocated) )
+#define array_UNUSABLE(x) ( !(x)->mem )
static bool
safemult_sizet(size_t a, size_t b, size_t *res)
{
if (array_UNUSABLE(a))
return 0;
+ assert(a->allocated);
return membersize ? a->used / membersize : 0;
}
if (array_UNUSABLE(src))
return false;
+ assert(src->allocated);
return array_copyb(dest, src->mem, src->used);
}