Fix bug in dstr_to_cstr
This commit is contained in:
parent
62f45b6a7f
commit
0d289df26f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user