diff options
| author | rsc <rsc> | 2006-09-06 16:38:39 +0000 | 
|---|---|---|
| committer | rsc <rsc> | 2006-09-06 16:38:39 +0000 | 
| commit | 45854caa93eecc3f80d34940b7cf6a400b640d69 (patch) | |
| tree | 7989c8a0ad97aad2da63b816a49f704a8aa58e5a | |
| parent | d90113b638ce1324544f8aaf75daa0d414907a33 (diff) | |
| download | xv6-labs-45854caa93eecc3f80d34940b7cf6a400b640d69.tar.gz xv6-labs-45854caa93eecc3f80d34940b7cf6a400b640d69.tar.bz2 xv6-labs-45854caa93eecc3f80d34940b7cf6a400b640d69.zip | |
print "0" for null string
| -rw-r--r-- | console.c | 10 | 
1 files changed, 7 insertions, 3 deletions
| @@ -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); | 
