aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-09 00:19:58 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-09 00:19:58 +0100
commitc374807e9d73014ce57eacbbaa56e05460288368 (patch)
treeaf9974aa6b03c9e25c9e42c108d9f25277665b41 /strbuf.c
parentFix minor memmory error. (diff)
downloadcalp-c374807e9d73014ce57eacbbaa56e05460288368.tar.gz
calp-c374807e9d73014ce57eacbbaa56e05460288368.tar.xz
Extend parsing to handle tree's of vcomponents.
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/strbuf.c b/strbuf.c
index 38aca4f4..8d1c7f15 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -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);
}