diff --git a/src/core/pp.c b/src/core/pp.c index cd545ad1..d058cb1e 100644 --- a/src/core/pp.c +++ b/src/core/pp.c @@ -809,7 +809,8 @@ static const char *scanformat( *(form++) = '%'; const char *p2 = strfrmt; while (p2 <= p) { - if (strchr(FMT_REPLACE_INTTYPES, *p2) != NULL) { + char *loc = strchr(FMT_REPLACE_INTTYPES, *p2); + if (loc != NULL && *loc != '\0') { const char *mapping = get_fmt_mapping(*p2++); size_t len = strlen(mapping); strcpy(form, mapping);