mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-24 12:44:23 +08: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
@ -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 New Issue
Block a user