Hunt down some small bugs

This commit is contained in:
Justine Tunney 2020-12-24 16:01:48 -08:00
parent 95b142e4e5
commit 830334d767
15 changed files with 1156 additions and 83 deletions

View file

@ -41,7 +41,7 @@ nodiscard char *tabpad(const char *s, unsigned width) {
size_t i, l, need;
l = strlen(s);
need = width > l ? (roundup(width, 8) - l - 1) / 8 + 1 : 0;
p = memcpy(malloc(l + need + 1), s, l);
p = memcpy(malloc(l + need + 2), s, l);
for (i = 0; i < need; ++i) p[l + i] = '\t';
if (!need) {
p[l] = ' ';