Skip to content

Commit

Permalink
Merge pull request #1106 from CosmicToast/1105
Browse files Browse the repository at this point in the history
handle null-byte case in scanformat (fixes #1105)
  • Loading branch information
bakpakin committed Apr 22, 2023
2 parents bef5bd7 + 0902a5a commit d9ed7a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d9ed7a7

Please sign in to comment.