mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 03:44:55 +00:00
tiny-printf: Avoid printing NULL strings
Add a check for NULL strings to avoid printing junk to the console. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
9ab401ae0e
commit
8e31681c5a
1 changed files with 4 additions and 2 deletions
|
@ -108,8 +108,10 @@ int vprintf(const char *fmt, va_list va)
|
||||||
w--;
|
w--;
|
||||||
while (w-- > 0)
|
while (w-- > 0)
|
||||||
putc(lz ? '0' : ' ');
|
putc(lz ? '0' : ' ');
|
||||||
while ((ch = *p++))
|
if (p) {
|
||||||
putc(ch);
|
while ((ch = *p++))
|
||||||
|
putc(ch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue