projects
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ab401a
)
tiny-printf: Avoid printing NULL strings
author
Simon Glass
<sjg@chromium.org>
Tue, 29 Dec 2015 12:22:46 +0000
(
05:22
-0700)
committer
Simon Glass
<sjg@chromium.org>
Thu, 21 Jan 2016 02:06:22 +0000
(19:06 -0700)
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>
lib/tiny-printf.c
patch
|
blob
|
history
diff --git
a/lib/tiny-printf.c
b/lib/tiny-printf.c
index
403b134
..
efe5c25
100644
(file)
--- a/
lib/tiny-printf.c
+++ b/
lib/tiny-printf.c
@@
-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);
+ }
}
}