growable string buffer: edge case
growable string buffer: edge case: a task in smol-software-harbor (Harbor dataset). sb append() in src/strbuf.c writes one byte past the end of its buffer when the new length is exactly the capacity: it forgets the terminating NUL when deciding whether to grow. Make sure the buffer always has room…
The task
`sb_append()` in `src/strbuf.c` writes one byte past the end of its buffer when the new length is exactly the capacity: it forgets the terminating NUL when deciding whether to grow. Make sure the buffer always has room for the string plus its terminator (`cap >= len + 1`). Run `make -B test`.
Part of efederici/smol-software-harbor.