Fix printing long hex
This commit is contained in:
parent
cb5e408525
commit
f8b1b2c5a7
@ -425,7 +425,8 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap)
|
||||
case 'x': {
|
||||
char val[sizeof(long long int) * 2];
|
||||
unsigned int valIdx = 0;
|
||||
long long int d = va_arg(ap, long long int);
|
||||
unsigned long long int d =
|
||||
va_arg(ap, unsigned long long int);
|
||||
itoa(d, val, 16);
|
||||
if (str) {
|
||||
while (val[valIdx]) {
|
||||
@ -453,7 +454,7 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap)
|
||||
case 'x': {
|
||||
char val[sizeof(int) * 2];
|
||||
unsigned int valIdx = 0;
|
||||
long int d = va_arg(ap, long int);
|
||||
unsigned long int d = va_arg(ap, unsigned long int);
|
||||
itoa(d, val, 16);
|
||||
if (str) {
|
||||
while (val[valIdx]) {
|
||||
|
Loading…
Reference in New Issue
Block a user