diff options
| author | 2013-09-05 13:36:26 +0200 | |
|---|---|---|
| committer | 2013-09-05 13:36:26 +0200 | |
| commit | 81be482f5397e8f17cab4c61a300440601df9056 (patch) | |
| tree | c1e010fd4c02262aced48ce583c6de749559c634 | |
| parent | 804850b4b24443fb5291d681b9325808f6416099 (diff) | |
| download | colorize-81be482f5397e8f17cab4c61a300440601df9056.tar.gz colorize-81be482f5397e8f17cab4c61a300440601df9056.tar.bz2 | |
Clear pointer before reusing
| -rw-r--r-- | colorize.c | 3 | 
1 files changed, 3 insertions, 0 deletions
| @@ -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)) | 
