From 45c51f71bf201c71d1591d567cccf30b6cf32d0b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 7 Apr 2002 09:58:22 +0000 Subject: [PATCH] * Bugfix einlesen von null-rassen * Bugfix einlesen von fehlerhaften events * Log-Message bei kaputten attributen und events. log beachten! --- src/common/kernel/race.c | 2 +- src/common/util/attrib.c | 3 ++- src/common/util/event.c | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/kernel/race.c b/src/common/kernel/race.c index 342812f88..9f6d52534 100644 --- a/src/common/kernel/race.c +++ b/src/common/kernel/race.c @@ -570,7 +570,7 @@ read_race_reference(const struct race ** rp, FILE * F) fscanf(F, "%s", zName); if (strcmp(zName, "none")==0) { *rp = NULL; - return AT_READ_FAIL; + return AT_READ_OK; } *rp = rc_find(zName); assert(*rp!=NULL); diff --git a/src/common/util/attrib.c b/src/common/util/attrib.c index aee7bc57e..74977c31d 100644 --- a/src/common/util/attrib.c +++ b/src/common/util/attrib.c @@ -230,7 +230,7 @@ a_age(attrib ** p) * hat Einfluß auf den Besitzer */ while(*ap) { attrib * a = *ap; - if(a->type->age && a->type->age(a)==0) a_remove(p, a); + if (a->type->age && a->type->age(a)==0) a_remove(p, a); else ap=&a->next; } return (*p!=NULL); @@ -264,6 +264,7 @@ a_read(FILE * f, attrib ** attribs) a_add(attribs, na); break; case AT_READ_FAIL: + log_warning(("reading attribute %s failed.", zText)); a_free(na); break; default: diff --git a/src/common/util/event.c b/src/common/util/event.c index b3d9ac2fc..f8fe285c0 100644 --- a/src/common/util/event.c +++ b/src/common/util/event.c @@ -17,6 +17,7 @@ /* util includes */ #include "attrib.h" +#include "log.h" /* libc includes */ #include @@ -54,7 +55,9 @@ read_triggers(FILE * F, trigger ** tp) tp = &(*tp)->next; break; case AT_READ_FAIL: + log_warning(("reading trigger for %s failed.", ttype->name)); t_free(*tp); + *tp = NULL; break; default: assert(!"invalid return value");