From: Steven Schubiger Date: Thu, 5 Sep 2013 11:36:26 +0000 (+0200) Subject: Clear pointer before reusing X-Git-Tag: v0.52~4 X-Git-Url: http://git.refcnt.org/?p=colorize.git;a=commitdiff_plain;h=81be482f5397e8f17cab4c61a300440601df9056 Clear pointer before reusing --- diff --git a/colorize.c b/colorize.c index 1efc7d9..35d14dc 100644 --- a/colorize.c +++ b/colorize.c @@ -484,6 +484,8 @@ process_args (unsigned int arg_cnt, char **arg_strings, bool *bold, const struct for (index = 0, color = str; *color; index++, color = p) { char *ch, *sep; + + p = NULL; if ((sep = strchr (color, COLOR_SEP_CHAR))) { *sep = '\0'; @@ -491,6 +493,7 @@ process_args (unsigned int arg_cnt, char **arg_strings, bool *bold, const struct } else p = color + strlen (color); + assert (p); for (ch = color; *ch; ch++) if (!isalpha (*ch))