Skip to content

Commit

Permalink
print "0" for null string
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Sep 6, 2006
1 parent d90113b commit 45854ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 45854ca

Please sign in to comment.