aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/common.cup3
1 files changed, 2 insertions, 1 deletions
diff --git a/std/common.cup b/std/common.cup
index b97c43a..abd7e82 100644
--- a/std/common.cup
+++ b/std/common.cup
@@ -157,7 +157,8 @@ fn putu_buffer(n: int, buf: char*): int {
if (i == 0) {
buf[i] = '0';
i = i + 1;
- } else {
+ } else if (i > 1) {
+ buf[i] = 0;
strrev(buf);
}
return i;