diff options
| author | 2022-10-25 09:32:41 +0200 | |
|---|---|---|
| committer | 2022-10-25 09:32:41 +0200 | |
| commit | fa870ab358ce94017228cdddf4697e041fc32531 (patch) | |
| tree | 326d5a13a525531b4c5c243160d215d7c28263ae /xs_set.h | |
| parent | Don't load unneeded actor info in html_entry(). (diff) | |
| download | penes-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.h | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -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) | |||
| 35 | void xs_set_free(xs_set *s) | 37 | void 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 | ||