This commit is contained in:
2020-03-19 10:14:51 +01:00
parent 29f04fbfd3
commit 5f74de71c3

2
cfg.h
View File

@@ -59,6 +59,7 @@ char* string_cstr(string* s) {
}
string string_from_cstr(char* c) {
assert(c != NULL);
size_t l = strlen(c);
string s = new_string_sized(l);
s.len = l;
@@ -72,6 +73,7 @@ void string_grow_min(string* s, size_t min_growth) {
}
void string_cappend(string* s, char* c) {
assert(c != NULL);
size_t l = strlen(c);
if (s->cap < s->len + l) string_grow_min(s, l);
memcpy(s->str+s->len, c, l);