mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 02:40:08 +00:00
Fixed wrong sign extension in printf on 64 bit
This patch fixes printf errors caused by sign extension of values that were supposed to be unsigned. Fixes #6. Also handles the case where sizeof(long long) != sizeof(long).
This commit is contained in:
parent
38ab3c50a5
commit
9508cc0ed5
@ -275,7 +275,8 @@ void Console::vprintf(const char *format, va_list list)
|
||||
|
||||
case Format_command::LONG:
|
||||
|
||||
numeric_arg = va_arg(list, long);
|
||||
numeric_arg = (cmd.type == Format_command::UINT) ?
|
||||
va_arg(list, unsigned long) : va_arg(list, long);
|
||||
break;
|
||||
|
||||
case Format_command::SIZE_T:
|
||||
@ -285,7 +286,8 @@ void Console::vprintf(const char *format, va_list list)
|
||||
|
||||
case Format_command::DEFAULT:
|
||||
|
||||
numeric_arg = va_arg(list, int);
|
||||
numeric_arg = (cmd.type == Format_command::UINT) ?
|
||||
va_arg(list, unsigned int) : va_arg(list, int);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user