assert without if
authorKrista Grothoff <krista@pep-project.org>
Mon, 17 Oct 2016 13:15:11 +0200
changeset 1283e5b5143795b5
parent 1281 efff88dcdc59
child 1284 ced04ed25f9b
assert without if
src/stringpair.c
     1.1 --- a/src/stringpair.c	Sat Oct 15 17:45:16 2016 +0200
     1.2 +++ b/src/stringpair.c	Mon Oct 17 13:15:11 2016 +0200
     1.3 @@ -11,8 +11,12 @@
     1.4      stringpair_t *pair = NULL;
     1.5  
     1.6      assert(key);
     1.7 -    assert(value),
     1.8 +    assert(value);
     1.9  
    1.10 +    if (!key || !value) {
    1.11 +        return NULL;
    1.12 +    }
    1.13 +    
    1.14      pair = calloc(1, sizeof(stringpair_t));
    1.15      assert(pair);
    1.16      if (pair == NULL)