handle printf("%s\n", 0)
This commit is contained in:
parent
43baa1f224
commit
b943284893
1 changed files with 2 additions and 0 deletions
2
printf.c
2
printf.c
|
@ -63,6 +63,8 @@ printf(int fd, char *fmt, ...)
|
||||||
} else if(c == 's'){
|
} else if(c == 's'){
|
||||||
s = (char*)*ap;
|
s = (char*)*ap;
|
||||||
ap++;
|
ap++;
|
||||||
|
if(s == 0)
|
||||||
|
s = "(null)";
|
||||||
while(*s != 0){
|
while(*s != 0){
|
||||||
putc(fd, *s);
|
putc(fd, *s);
|
||||||
s++;
|
s++;
|
||||||
|
|
Loading…
Reference in a new issue