mirror of
https://github.com/curl/curl.git
synced 2026-05-28 02:56:21 +03:00
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:
parent
8eb3cb75a3
commit
4f7e323b29
1 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue