提交 8e31681c 编写于 作者: S Simon Glass

tiny-printf: Avoid printing NULL strings

Add a check for NULL strings to avoid printing junk to the console.
Signed-off-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NStefan Roese <sr@denx.de>
上级 9ab401ae
......@@ -108,10 +108,12 @@ int vprintf(const char *fmt, va_list va)
w--;
while (w-- > 0)
putc(lz ? '0' : ' ');
if (p) {
while ((ch = *p++))
putc(ch);
}
}
}
abort:
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册