summaryrefslogtreecommitdiff
path: root/table.c
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-11-26 02:19:27 -0500
committerTest_User <hax@andrewyu.org>2023-11-26 02:19:27 -0500
commit16049194444f9acc27b9ed6b8de6b39651c5a8fd (patch)
tree968f2a253b8093b454f58a5491a62e2515161941 /table.c
parentf79a5dbfbadf78baf5683eede02a8454e403f58e (diff)
downloadcoupserv-16049194444f9acc27b9ed6b8de6b39651c5a8fd.tar.gz
coupserv-16049194444f9acc27b9ed6b8de6b39651c5a8fd.zip
Fix memory errors, disable spam command
Diffstat (limited to 'table.c')
-rw-r--r--table.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/table.c b/table.c
index a4adf61..d80d7fd 100644
--- a/table.c
+++ b/table.c
@@ -161,7 +161,7 @@ void * remove_table_index(struct table *tbl, struct string name) {
void *ptr = tbl->array[index].ptr;
free(tbl->array[index].name.data);
- memmove(&(tbl->array[index]), &(tbl->array[index+1]), (tbl->len - index) * sizeof(*(tbl->array)));
+ memmove(&(tbl->array[index]), &(tbl->array[index+1]), (tbl->len - index - 1) * sizeof(*(tbl->array)));
tbl->len--;
void *tmp = realloc(tbl->array, sizeof(*(tbl->array)) * tbl->len);