added basic string builder

This commit is contained in:
2025-12-06 21:37:23 +01:00
parent 234eb510a9
commit e76d553f1a
3 changed files with 142 additions and 1 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ void scanner_error(scanner_t *s, const char *message) {
}
// need 40 bytes for pair of largest possible 64 bit values, then some for
// ':' and ' ' characters. Just rounded up to 64 because reasons.
size_t length = strlen(s->name) + strlen(message) + 64;
size_t length = strlen(s->name) + 1 + strlen(message) + 1 + 64;
char *buf = allocator_alloc(s->allocator, length);
snprintf(
buf,