summaryrefslogtreecommitdiff
path: root/xs_set.h
diff options
context:
space:
mode:
authorGravatar default2022-10-25 09:32:41 +0200
committerGravatar default2022-10-25 09:32:41 +0200
commitfa870ab358ce94017228cdddf4697e041fc32531 (patch)
tree326d5a13a525531b4c5c243160d215d7c28263ae /xs_set.h
parentDon't load unneeded actor info in html_entry(). (diff)
downloadpenes-snac2-fa870ab358ce94017228cdddf4697e041fc32531.tar.gz
penes-snac2-fa870ab358ce94017228cdddf4697e041fc32531.tar.xz
penes-snac2-fa870ab358ce94017228cdddf4697e041fc32531.zip
Backport from xs.
Diffstat (limited to 'xs_set.h')
-rw-r--r--xs_set.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/xs_set.h b/xs_set.h
index 2beb454..0d76bed 100644
--- a/xs_set.h
+++ b/xs_set.h
@@ -22,7 +22,9 @@ xs_set *xs_set_new(int elems)
22/* creates a new set with a maximum of size hashed data */ 22/* creates a new set with a maximum of size hashed data */
23{ 23{
24 int sz = sizeof(struct _xs_set) + sizeof(int) * elems; 24 int sz = sizeof(struct _xs_set) + sizeof(int) * elems;
25 xs_set *s = calloc(sz, 1); 25 xs_set *s = xs_realloc(NULL, sz);
26
27 memset(s, '\0', sz);
26 28
27 /* initialize */ 29 /* initialize */
28 s->elems = elems; 30 s->elems = elems;
@@ -35,8 +37,8 @@ xs_set *xs_set_new(int elems)
35void xs_set_free(xs_set *s) 37void xs_set_free(xs_set *s)
36/* frees a set */ 38/* frees a set */
37{ 39{
38 free(s->list); 40 xs_free(s->list);
39 free(s); 41 xs_free(s);
40} 42}
41 43
42 44