X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fhash.c;h=2544a75d0dcd025f82668bfc24a47dfaeb2ad70c;hb=4239c455e7b1061b7c960b793f9080e113123845;hp=a73256589ab69d55fce8252be7fa16074f0834a0;hpb=5156fa5a8323a16f6b4bbc8950221cdc1d0e023d;p=pspp-builds.git diff --git a/src/hash.c b/src/hash.c index a7325658..2544a75d 100644 --- a/src/hash.c +++ b/src/hash.c @@ -142,7 +142,9 @@ hsh_create (int size, hsh_compare_func *compare, hsh_hash_func *hash, struct hsh_table *h; int i; - assert (size > 0); + if ( size == 0 ) + return NULL; + assert (compare != NULL); assert (hash != NULL);