print "0" for null string
This commit is contained in:
parent
d90113b638
commit
45854caa93
1 changed files with 7 additions and 3 deletions
|
@ -129,10 +129,14 @@ cprintf(char *fmt, ...)
|
||||||
} else if(c == 's'){
|
} else if(c == 's'){
|
||||||
char *s = (char*)*ap;
|
char *s = (char*)*ap;
|
||||||
ap++;
|
ap++;
|
||||||
|
if(s == 0){
|
||||||
|
cons_putc('0');
|
||||||
|
}else{
|
||||||
while(*s != 0){
|
while(*s != 0){
|
||||||
cons_putc(*s);
|
cons_putc(*s);
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if(c == '%'){
|
} else if(c == '%'){
|
||||||
cons_putc(c);
|
cons_putc(c);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue