summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'console.c')
-rw-r--r--console.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/console.c b/console.c
index 19b3296..634e9e8 100644
--- a/console.c
+++ b/console.c
@@ -27,15 +27,16 @@ printint(int xx, int base, int sgn)
{
static char digits[] = "0123456789abcdef";
char buf[16];
- int i = 0, neg = 0;
+ int i, neg;
uint x;
- if(sgn && xx < 0){
+ if(sgn && (neg = xx < 0)){
neg = 1;
x = -xx;
} else
x = xx;
+ i = 0;
do{
buf[i++] = digits[x % base];
}while((x /= base) != 0);