aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-06 23:45:09 -0500
committerMustafa Quraish <[email protected]>2022-02-07 03:18:08 -0500
commit273671ff063c62af3a133f3dda67f33867f225e2 (patch)
tree02269d9d069a26f6048851f5f21aecbe72b02915 /std
parent[cup] Add support for string literals (diff)
downloadcup-273671ff063c62af3a133f3dda67f33867f225e2.tar.xz
cup-273671ff063c62af3a133f3dda67f33867f225e2.zip
[cup] Add support for `here` keyword + fix `putu_buffer` bug
Diffstat (limited to 'std')
-rw-r--r--std/common.cup6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/common.cup b/std/common.cup
index 3d0b269..dac8148 100644
--- a/std/common.cup
+++ b/std/common.cup
@@ -157,10 +157,10 @@ fn putu_buffer(n: int, buf: char*): int {
if (i == 0) {
buf[i] = '0';
i = i + 1;
- } else if (i > 1) {
- buf[i] = 0;
- strrev(buf);
}
+ buf[i] = 0;
+ if (i > 1)
+ strrev(buf);
return i;
}