mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Hunt down some small bugs
This commit is contained in:
parent
95b142e4e5
commit
830334d767
15 changed files with 1156 additions and 83 deletions
|
@ -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] = ' ';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue