mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 07:31:15 +00:00
tiny-printf: Support %i
The most basic printf("%i", value) formating string was missing, add it for the sake of convenience. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
b641dd3ec8
commit
e7882f65f0
1 changed files with 2 additions and 1 deletions
|
@ -242,6 +242,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
|
|||
goto abort;
|
||||
case 'u':
|
||||
case 'd':
|
||||
case 'i':
|
||||
div = 1000000000;
|
||||
if (islong) {
|
||||
num = va_arg(va, unsigned long);
|
||||
|
@ -251,7 +252,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
|
|||
num = va_arg(va, unsigned int);
|
||||
}
|
||||
|
||||
if (ch == 'd') {
|
||||
if (ch != 'u') {
|
||||
if (islong && (long)num < 0) {
|
||||
num = -(long)num;
|
||||
out(info, '-');
|
||||
|
|
Loading…
Reference in a new issue