commit 45854caa93eecc3f80d34940b7cf6a400b640d69
parent d90113b638ce1324544f8aaf75daa0d414907a33
Author: rsc <rsc>
Date: Wed, 6 Sep 2006 16:38:39 +0000
print "0" for null string
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/console.c b/console.c
@@ -129,9 +129,13 @@ cprintf(char *fmt, ...)
} else if(c == 's'){
char *s = (char*)*ap;
ap++;
- while(*s != 0){
- cons_putc(*s);
- s++;
+ if(s == 0){
+ cons_putc('0');
+ }else{
+ while(*s != 0){
+ cons_putc(*s);
+ s++;
+ }
}
} else if(c == '%'){
cons_putc(c);