From: Peter Maydell Date: Mon, 20 Dec 2010 21:13:32 +0000 (+0000) Subject: Fix used-uninitialised warning in new.c X-Git-Tag: mmh-start~7 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=93f22073ff22b277206b0481c1f8f076aee1656d;p=mmh Fix used-uninitialised warning in new.c Fix a used-uninitialised warning in new.c by having the check_folders() routine return first=last=NULL for empty folder lists. This is a more sensible API anyway. (It would not actually have been possible for the code to try to use last while it was uninitialised, as it happens.) Signed-off-by: Peter Maydell --- diff --git a/uip/new.c b/uip/new.c index 254950b..99d8528 100644 --- a/uip/new.c +++ b/uip/new.c @@ -218,6 +218,8 @@ crawl_callback(char *folder, void *baton) * `cur' points to the name of the current folder, `folders' points to the * name of a .folder (if NULL, crawl all folders), and `sequences' points to * the array of sequences for which to look. + * + * An empty list is returned as first=last=NULL. */ static void check_folders(struct node **first, struct node **last, @@ -229,7 +231,7 @@ check_folders(struct node **first, struct node **last, char *line; size_t len; - *first = *cur_node = NULL; + *first = *last = *cur_node = NULL; *maxlen = 0; b.first = first;