From 86054bae08766d22f584ff304e4ec30fa82586da Mon Sep 17 00:00:00 2001 From: cy384 Date: Thu, 23 Jul 2020 19:58:25 -0400 Subject: [PATCH] fix printing of 0 integer --- ssheven-console.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssheven-console.c b/ssheven-console.c index bf3bc67..e5467d5 100644 --- a/ssheven-console.c +++ b/ssheven-console.c @@ -114,6 +114,12 @@ void print_int(int d) char buffer[12] = {0}; int i = 10; + if (d == 0) + { + buffer[0] = '0'; + i = -1; + } + for (; d > 0; i--) { buffer[i] = itoc[d % 10];