print "0" for null string

This commit is contained in:
rsc 2006-09-06 16:38:39 +00:00
parent d90113b638
commit 45854caa93

View file

@ -129,9 +129,13 @@ cprintf(char *fmt, ...)
} else if(c == 's'){ } else if(c == 's'){
char *s = (char*)*ap; char *s = (char*)*ap;
ap++; ap++;
while(*s != 0){ if(s == 0){
cons_putc(*s); cons_putc('0');
s++; }else{
while(*s != 0){
cons_putc(*s);
s++;
}
} }
} else if(c == '%'){ } else if(c == '%'){
cons_putc(c); cons_putc(c);