Fix #586 segfault: Update the charmaps hashmap when an existing charmap is resized

This commit is contained in:
Rangi
2020-10-07 13:20:30 -04:00
parent f9daf27511
commit effc6788eb
3 changed files with 27 additions and 0 deletions

View File

@@ -173,6 +173,7 @@ void charmap_Add(char *mapping, uint8_t value)
if (currentCharmap->usedNodes == currentCharmap->capacity) {
currentCharmap->capacity *= 2;
currentCharmap = resizeCharmap(currentCharmap, currentCharmap->capacity);
hash_ReplaceElement(charmaps, currentCharmap->name, currentCharmap);
}
/* Switch to and init new node */