Skip to content
Snippets Groups Projects
Commit 8e31681c authored by Simon Glass's avatar Simon Glass
Browse files

tiny-printf: Avoid printing NULL strings


Add a check for NULL strings to avoid printing junk to the console.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
parent 9ab401ae
No related branches found
No related tags found
No related merge requests found
...@@ -108,10 +108,12 @@ int vprintf(const char *fmt, va_list va) ...@@ -108,10 +108,12 @@ int vprintf(const char *fmt, va_list va)
w--; w--;
while (w-- > 0) while (w-- > 0)
putc(lz ? '0' : ' '); putc(lz ? '0' : ' ');
if (p) {
while ((ch = *p++)) while ((ch = *p++))
putc(ch); putc(ch);
} }
} }
}
abort: abort:
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment