aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-08-21 19:40:00 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-08-21 19:40:00 +0200
commit6f99ef55a8bd75d99882078b50e3c7665106c514 (patch)
treeca33103b5612e2df6526db2dda1c97aba87350f6
parent4e13b732453105104901c253b7989c16e812c112 (diff)
downloadmblaze-6f99ef55a8bd75d99882078b50e3c7665106c514.tar.gz
mgenmid: printb36: fix off-by-one
Closes #73.
-rw-r--r--mgenmid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mgenmid.c b/mgenmid.c
index 36aa8c8..655df95 100644
--- a/mgenmid.c
+++ b/mgenmid.c
@@ -21,9 +21,10 @@ printb36(uint64_t x)
char outbuf[16];
char *o = outbuf + sizeof outbuf;
- *o = 0;
+ *--o = 0;
do { *--o = base36[x % 36]; } while (x /= 36);
+
fputs(o, stdout);
}