nt

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

commit b96fc55b067ca0e344093673bc8dc36eaeea2508
parent 51cb9985482dca5b64a417a719253ad07e90d6bc
Author: Ed van Bruggen <edvb54@gmail.com>
Date:   Fri, 18 Aug 2017 15:57:52 -0700

Remove unnecessary NULL checks

Diffstat:
nt.c | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/nt.c b/nt.c @@ -54,8 +54,6 @@ int lsnum; void linkadd(char *str) { - if (!str) die("linkadd: given null pointer"); - if (!head->str && !head->next && !head->prev) { head = ecalloc(1, sizeof(Note)); head->str = estrdup(str); @@ -83,11 +81,11 @@ linkadd(char *str) int confirm(const char *msg, ...) { - if (yes) return 1; - char input = 'n'; va_list ap; + if (yes) return 1; + va_start(ap, msg); printf("%s: ", argv0); vprintf(msg, ap); @@ -102,8 +100,6 @@ confirm(const char *msg, ...) char * get_cat(char *str) { - if (!str) die("get_cat: given null pointer"); - char *cat = estrdup(str); char delim[2] = { catdelim, 0 };