diff options
author | Test_User <hax@andrewyu.org> | 2023-12-14 17:05:30 -0500 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2023-12-14 17:05:30 -0500 |
commit | 8fef1ea4dc6076f74a47a087cf3936819172926e (patch) | |
tree | c8a811376b761fbc8f5f192fadad59223f4e133d /table.c | |
parent | 8532945fa2fc05e4954cb30d8687eaadefcaaba1 (diff) | |
download | c_coupserv-8fef1ea4dc6076f74a47a087cf3936819172926e.tar.gz c_coupserv-8fef1ea4dc6076f74a47a087cf3936819172926e.zip |
yet another bug in my table code
Diffstat (limited to 'table.c')
-rw-r--r-- | table.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -165,7 +165,7 @@ void * remove_table_index(struct table *tbl, struct string name) { tbl->len--; void *tmp = realloc(tbl->array, sizeof(*(tbl->array)) * tbl->len); - if (tmp) + if (tmp || (tbl->len == 0)) tbl->array = tmp; // else: realloc failed on shrinking... so now we have a table that's allocated a bit too big, not much of an issue |