From f4bbedd3c897115bb41536e48be21aee1e89e0e5 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Mon, 29 Jun 2015 09:46:03 +0200 Subject: [PATCH] use place holder for ascii code 0 => 0 terminates a C string => bad for linux, because linux copies the messages via strcpy to the user-space --- hermit/libkern/stdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hermit/libkern/stdio.c b/hermit/libkern/stdio.c index 4983ce9a3..e673458ac 100644 --- a/hermit/libkern/stdio.c +++ b/hermit/libkern/stdio.c @@ -62,6 +62,10 @@ int kputchar(int c) { int pos; + /* add place holder for end of string */ + if (!c) + c = '?'; + if (early_print != NO_EARLY_PRINT) spinlock_irqsave_lock(&olock);