mprintf: treat %o as unsigned, add tests for %o, %x, %X

`%x` and `%X` were already treated as unsigned, but `%o` was not, even
though it was used with unsigned numbers.

Closes #15348
This commit is contained in:
ArtSin 2024-10-22 14:24:45 +04:00 committed by Daniel Stenberg
parent 7ca164faba
commit 0325e1b9b2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 50 additions and 4 deletions

View file

@ -456,12 +456,12 @@ static int parsefmt(const char *format,
break;
case 'o':
if(flags & FLAGS_LONGLONG)
type = FORMAT_LONGLONG;
type = FORMAT_LONGLONGU;
else if(flags & FLAGS_LONG)
type = FORMAT_LONG;
type = FORMAT_LONGU;
else
type = FORMAT_INT;
flags |= FLAGS_OCTAL;
type = FORMAT_INTU;
flags |= FLAGS_OCTAL|FLAGS_UNSIGNED;
break;
case 'x':
if(flags & FLAGS_LONGLONG)