mirror of
https://github.com/cy384/ssheven.git
synced 2026-05-21 06:45:34 -06:00
fix printing of 0 integer
This commit is contained in:
parent
9b319d7b77
commit
86054bae08
1 changed files with 6 additions and 0 deletions
|
|
@ -114,6 +114,12 @@ void print_int(int d)
|
||||||
char buffer[12] = {0};
|
char buffer[12] = {0};
|
||||||
int i = 10;
|
int i = 10;
|
||||||
|
|
||||||
|
if (d == 0)
|
||||||
|
{
|
||||||
|
buffer[0] = '0';
|
||||||
|
i = -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (; d > 0; i--)
|
for (; d > 0; i--)
|
||||||
{
|
{
|
||||||
buffer[i] = itoc[d % 10];
|
buffer[i] = itoc[d % 10];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue