Make DoInt properly print "0" values.

This commit is contained in:
Stefan `Sec` Zehl 2011-07-09 14:53:01 +02:00
parent 0abca10597
commit 5feababa13
1 changed files with 6 additions and 1 deletions

View File

@ -176,6 +176,9 @@ int DoInt(int sx, int sy, int num){
num=-num; num=-num;
neg=1; neg=1;
}; };
if(num==0){
neg=2;
};
for (len=(mxlen-1);len>=0;len--){ for (len=(mxlen-1);len>=0;len--){
s[len]=(num%10)+'0'; s[len]=(num%10)+'0';
@ -186,8 +189,10 @@ int DoInt(int sx, int sy, int num){
}; };
num/=10; num/=10;
}; };
if(neg) if(neg==1)
*o='-'; *o='-';
if(neg==2)
*o='0';
return DoString(sx,sy,o); return DoString(sx,sy,o);
#undef mxlen #undef mxlen
}; };