Fix bug in dstr_to_cstr

This commit is contained in:
Abdelrahman Said 2023-06-20 21:56:33 +01:00
parent 62f45b6a7f
commit 0d289df26f

View File

@ -171,4 +171,10 @@ u64 dstr_capacity(const dstr_t *str) {
return str->capacity;
}
const char *dstr_to_cstr(const dstr_t *str) { return str->buf; }
const char *dstr_to_cstr(const dstr_t *str) {
if (!str) {
return "";
}
return str->buf;
}