diff options
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -82,6 +82,12 @@ int strbuf_copy(strbuf* dest, strbuf* src) { } int strbuf_cmp(strbuf* a, strbuf* b) { +#ifdef SAFE_STR + if (a->alloc == 0 || b->alloc == 0) { + ERR("a or b not alloced"); + return -1; + } +#endif return strcmp(a->mem, b->mem); } |