diff options
author | Russ Cox <[email protected]> | 2011-02-28 09:32:20 -0500 |
---|---|---|
committer | Russ Cox <[email protected]> | 2011-02-28 09:32:20 -0500 |
commit | c5f538735191330cc112485548e6dc46317eea83 (patch) | |
tree | 92175f170c56754ed5df2d48b3bb3fae8b56d1b4 /console.c | |
parent | a6cd7509c4cb30a7d58aa2797dc979daaa795fd0 (diff) | |
download | xv6-labs-c5f538735191330cc112485548e6dc46317eea83.tar.gz xv6-labs-c5f538735191330cc112485548e6dc46317eea83.tar.bz2 xv6-labs-c5f538735191330cc112485548e6dc46317eea83.zip |
fixes from Peter Froehlich
Diffstat (limited to 'console.c')
-rw-r--r-- | console.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -23,24 +23,24 @@ static struct { } cons; static void -printint(int xx, int base, int sgn) +printint(int xx, int base, int sign) { static char digits[] = "0123456789abcdef"; char buf[16]; - int i, neg; + int i; uint x; - if(sgn && (neg = xx < 0)){ - neg = 1; + if(sign && (sign = xx < 0)) x = -xx; - } else + else x = xx; i = 0; do{ buf[i++] = digits[x % base]; }while((x /= base) != 0); - if(neg) + + if(sign) buf[i++] = '-'; while(--i >= 0) |