add inv saving, fix bugs
This commit is contained in:
parent
4bef1a220c
commit
d5e55b54ee
5 changed files with 26 additions and 10 deletions
|
@ -26,7 +26,7 @@ int load_elements(hashmap *m, char *table, int use_inv) {
|
|||
did_something = 1;
|
||||
|
||||
if (use_inv) {
|
||||
hashmap_set(m, str, strlen(str) - 2, (uintptr_t)1);
|
||||
hashmap_set(m, str, strlen(str) - 1, (uintptr_t)1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -37,13 +37,12 @@ int load_elements(hashmap *m, char *table, int use_inv) {
|
|||
hashmap_set(m, combo, strlen(combo) - 1, (uintptr_t)str);
|
||||
}
|
||||
|
||||
|
||||
printf("%i\n",did_something);
|
||||
|
||||
if (!did_something) {
|
||||
free(str);
|
||||
}
|
||||
|
||||
fclose(fptr);
|
||||
|
||||
return did_something;
|
||||
|
||||
// todo: properly free this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue