Error -> errset (temporarily). Catch / throw now works, but it will not yet correctly handle defer.

This commit is contained in:
Christoffer Lerno
2020-05-03 02:04:13 +02:00
parent 78aa49cc0e
commit 373001fd12
23 changed files with 1268 additions and 209 deletions

View File

@@ -21,4 +21,15 @@ char *strformat(const char *var, ...)
va_end(list);
assert(len == new_len);
return buffer;
}
char *strcat_arena(const char *a, const char *b)
{
unsigned a_len = strlen(a);
unsigned b_len = strlen(b);
char *buffer = malloc_arena(a_len + b_len + 1);
memcpy(buffer, a, a_len);
memcpy(buffer + a_len, b, b_len);
buffer[a_len + b_len] = '\0';
return buffer;
}