denkfehler

This commit is contained in:
Enno Rehling 2003-09-21 09:45:25 +00:00
parent a9c5c86c9d
commit 737b0fedb4
1 changed files with 4 additions and 1 deletions

View File

@ -1278,7 +1278,10 @@ static void
s_change(stats_t** s, const struct item_type * type, int count) s_change(stats_t** s, const struct item_type * type, int count)
{ {
while (*s && (*s)->type!=type) s=&(*s)->next; while (*s && (*s)->type!=type) s=&(*s)->next;
if (*s==NULL) *s = calloc(1, sizeof(stats_t)); if (*s==NULL) {
*s = calloc(1, sizeof(stats_t));
(*s)->type = type;
}
(*s)->number += count; (*s)->number += count;
} }