summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/init/stdlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/init/stdlib.c b/src/init/stdlib.c
index a60854b..4bc90d2 100644
--- a/src/init/stdlib.c
+++ b/src/init/stdlib.c
@@ -39,8 +39,10 @@ int printf(const char *fmt, ...) {
switch (c) {
case 's':
const char *s = va_arg(argp, char*);
- _syscall_write(0, s, strlen(s), 0);
- total += strlen(s);
+ if (s) {
+ _syscall_write(0, s, strlen(s), 0);
+ total += strlen(s);
+ }
break;
case 'x':