diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pcregrep.c | 8 |
2 files changed, 8 insertions, 3 deletions
@@ -20,6 +20,9 @@ several lines after the start. 4. A (?# style comment is now ignored between a basic quantifier and a following '+' or '?' (example: /X+(?#comment)?Y/. +5. Avoid use of a potentially overflowing buffer in pcregrep (patch by Petr +Pisar). + Version 8.40 11-January-2017 ---------------------------- @@ -3190,9 +3190,11 @@ for (j = 1, cp = patterns; cp != NULL; j++, cp = cp->next) cp->hint = pcre_study(cp->compiled, study_options, &error); if (error != NULL) { - char s[16]; - if (patterns->next == NULL) s[0] = 0; else sprintf(s, " number %d", j); - fprintf(stderr, "pcregrep: Error while studying regex%s: %s\n", s, error); + if (patterns->next == NULL) + fprintf(stderr, "pcregrep: Error while studying regex: %s\n", error); + else + fprintf(stderr, "pcregrep: Error while studying regex number %d: %s\n", + j, error); goto EXIT2; } #ifdef SUPPORT_PCREGREP_JIT |