nt

Unnamed repository; edit this file 'description' to name the repository.
git clone git://edryd.org/nt
Log | Files | Refs | LICENSE

commit 8f4179b5965065c23a44e64921a8e7edf1a5277c
parent 1a707f9848fbaabb0329ac85fe2ce5a34ff9894a
Author: Ed van Bruggen <edvb54@gmail.com>
Date:   Tue, 21 Mar 2017 20:09:22 -0700

Clean up util.c, stop testing against NULL

Diffstat:
util.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/util.c b/util.c @@ -42,7 +42,7 @@ erealloc(void *p, size_t size) char * estrdup(char *s) { - if ((s = strdup(s)) == NULL) + if (!(s = strdup(s))) die("strdup: out of memory"); return s; @@ -51,7 +51,7 @@ estrdup(char *s) char * strconcat(char **s, int c) { - if (s == NULL) die("strconcat: given null pointer"); + if (!s) die("strconcat: given null pointer"); int len, i; char *ret; @@ -74,7 +74,7 @@ strconcat(char **s, int c) char ** strsplit(const char *s, const char a_delim, int *size) { - if (s == NULL) die("strsplit: given null pointer"); + if (!s) die("strsplit: given null pointer"); char **ret = 0; size_t count = 0;