F*ck this MSVC message:

warning C6001: Using uninitialized memory
It is confused, and I screwed up trying to work around it.
This commit is contained in:
Enno Rehling 2018-11-17 22:12:34 +01:00
parent aa466f3cc8
commit 4403552b61
2 changed files with 3 additions and 5 deletions

View File

@ -3479,10 +3479,9 @@ static void free_fighter(fighter * fig)
armor **ap = &fig->armors;
while (*ap) {
armor *a = *ap;
ap = &a->next;
*ap = a->next;
free(a);
}
fig->armors = NULL;
while (fig->loot) {
i_free(i_remove(&fig->loot, fig->loot));
}
@ -3500,7 +3499,7 @@ static void battle_free(battle * b) {
fighter **fp = &s->fighters;
while (*fp) {
fighter *fig = *fp;
fp = &fig->next;
*fp = fig->next;
free_fighter(fig);
free(fig);
}

View File

@ -1258,10 +1258,9 @@ void free_unit(unit * u)
while (*pres) {
struct reservation *res = *pres;
pres = &res->next;
*pres = res->next;
free(res);
}
u->reservations = NULL;
if (u->skills) {
free(u->skills);
u->skills = NULL;