From 043380ae849d307087b18788ba19c565a217deca Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 2 Nov 2002 14:48:12 +0000 Subject: [PATCH] Assert was invalid illegal parameters to scanf --- src/common/kernel/curse.c | 4 ++-- src/common/kernel/item.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/kernel/curse.c b/src/common/kernel/curse.c index 0116f6c29..8d3323013 100644 --- a/src/common/kernel/curse.c +++ b/src/common/kernel/curse.c @@ -352,8 +352,8 @@ curse_changevigour(attrib **ap, curse *c, int vigour) int curse_geteffect(const curse *c) { - assert(c); - return c->effect.i; + if (c) return c->effect.i; + return 0; } /* ------------------------------------------------------------- */ diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 932e851e9..a2aae6b3b 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -2162,7 +2162,7 @@ tagbegin(struct xml_stack * stack) if (!strcmp(semi, "flags")) it->flags=i; break; case 'g': - if (!strcmp(semi, "give")) it->give = (int (*)(const unit*, const unit*, const struct item_type *, int, const char *))get_function(s); + if (!strcmp(semi, "give")) it->give = (boolean (*)(const unit*, const unit*, const struct item_type *, int, const char *))get_function(s); break; case 'u': if (!strcmp(semi, "use")) it->use = (int (*)(unit *, const struct item_type *, int, const char *))get_function(s); @@ -2554,7 +2554,7 @@ it_read(FILE * F) if (!strcmp(semi, "flags")) it->flags=i; break; case 'g': - if (!strcmp(semi, "give")) it->give = (int (*)(const unit*, const unit*, const struct item_type *, int, const char *))get_function(s); + if (!strcmp(semi, "give")) it->give = (boolean (*)(const unit*, const unit*, const struct item_type *, int, const char *))get_function(s); break; case 'u': if (!strcmp(semi, "use")) it->use = (int (*)(unit *, const struct item_type *, int, const char *))get_function(s);