mprintf: OR the flags

As 'flags' may already have been set to something when
parse_conversion() is called, make sure to only OR the new flags.

Follow-up to 4e0bfd8cf7

Closes #21398
This commit is contained in:
Daniel Stenberg 2026-04-21 14:33:27 +02:00
parent 8eb3cb75a3
commit 4f7e323b29
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -333,7 +333,7 @@ static bool parse_conversion(const char f, unsigned int *flagp,
FormatType type;
switch(f) {
case 'S':
flags = FLAGS_ALT;
flags |= FLAGS_ALT;
type = MTYPE_STRING;
break;
case 's':
@ -361,7 +361,7 @@ static bool parse_conversion(const char f, unsigned int *flagp,
type = MTYPE_LONGU;
else
type = MTYPE_INTU;
flags = FLAGS_UNSIGNED;
flags |= FLAGS_UNSIGNED;
break;
case 'o':
if(flags & FLAGS_LONGLONG)
@ -370,7 +370,7 @@ static bool parse_conversion(const char f, unsigned int *flagp,
type = MTYPE_LONGU;
else
type = MTYPE_INTU;
flags = FLAGS_OCTAL | FLAGS_UNSIGNED;
flags |= FLAGS_OCTAL | FLAGS_UNSIGNED;
break;
case 'x':
if(flags & FLAGS_LONGLONG)
@ -379,7 +379,7 @@ static bool parse_conversion(const char f, unsigned int *flagp,
type = MTYPE_LONGU;
else
type = MTYPE_INTU;
flags = FLAGS_HEX | FLAGS_UNSIGNED;
flags |= FLAGS_HEX | FLAGS_UNSIGNED;
break;
case 'X':
if(flags & FLAGS_LONGLONG)