fixes from Peter Froehlich
This commit is contained in:
parent
a6cd7509c4
commit
c5f5387351
3 changed files with 8 additions and 8 deletions
12
console.c
12
console.c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue