From 16049194444f9acc27b9ed6b8de6b39651c5a8fd Mon Sep 17 00:00:00 2001 From: Test_User Date: Sun, 26 Nov 2023 02:19:27 -0500 Subject: Fix memory errors, disable spam command --- table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'table.c') 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); -- cgit v1.2.3