summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-28 04:15:35 +0000
committerrsc <rsc>2007-08-28 04:15:35 +0000
commitb9432848937dc5250a90f9c9325af5bd4a59ade9 (patch)
tree9ff7fee885c507889e8b2483896d97108ab2f0e0
parent43baa1f22417ef920c718731d3a2741c52c516fb (diff)
downloadxv6-labs-b9432848937dc5250a90f9c9325af5bd4a59ade9.tar.gz
xv6-labs-b9432848937dc5250a90f9c9325af5bd4a59ade9.tar.bz2
xv6-labs-b9432848937dc5250a90f9c9325af5bd4a59ade9.zip
handle printf("%s\n", 0)
-rw-r--r--printf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/printf.c b/printf.c
index 0ddd90b..ad9c758 100644
--- a/printf.c
+++ b/printf.c
@@ -63,6 +63,8 @@ printf(int fd, char *fmt, ...)
} else if(c == 's'){
s = (char*)*ap;
ap++;
+ if(s == 0)
+ s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;