notaz.gp2x.de
/
ginge.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c88874
)
don't crash on null strings
author
notaz
<notasas@gmail.com>
Thu, 14 Jan 2016 22:35:25 +0000
(
00:35
+0200)
committer
notaz
<notasas@gmail.com>
Thu, 14 Jan 2016 22:35:25 +0000
(
00:35
+0200)
loader/llibc.c
patch
|
blob
|
blame
|
history
diff --git
a/loader/llibc.c
b/loader/llibc.c
index
3a0205f
..
c19e11d
100644
(file)
--- a/
loader/llibc.c
+++ b/
loader/llibc.c
@@
-168,7
+168,9
@@
void g_fprintf(int fd, const char *fmt, ...)
if (*s == 'l' || *s == 'z')
s++; // ignore for now
if (*s == 's') {
- char *ns = va_arg(ap, char *);
+ const char *ns = va_arg(ap, const char *);
+ if (ns == NULL)
+ ns = "(null)";
int len = strlen(ns);
while (justify > len && left > 1) {
*d++ = ' ';