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,8 +108,10 @@ int vprintf(const char *fmt, va_list va)
w--;
while (w-- > 0)
putc(lz ? '0' : ' ');
while ((ch = *p++))
putc(ch);
if (p) {
while ((ch = *p++))
putc(ch);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment