hashtable memset issue fix

This commit is contained in:
aks 2024-06-14 07:06:23 +04:00
parent 40a33e7bb7
commit f49f739333
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ hashtable_expand(switch_hashtable_t *h)
realloc(h->table, newsize * sizeof(struct entry *));
if (NULL == newtable) { (h->primeindex)--; return 0; }
h->table = newtable;
memset(newtable[h->tablelength], 0, newsize - h->tablelength);
memset(&newtable[h->tablelength], 0, ((newsize - h->tablelength) * sizeof(struct entry*)));
for (i = 0; i < h->tablelength; i++) {
for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
index = indexFor(newsize,e->h);