From 4886d2940167ca58efd5f9fd189261518ee14156 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 2 Feb 2020 18:52:30 +0100 Subject: [PATCH] small code cleanup --- src/spells.c | 5 ++--- src/util/param.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/spells.c b/src/spells.c index 6cff4bb9b..de2036225 100644 --- a/src/spells.c +++ b/src/spells.c @@ -2358,9 +2358,8 @@ static void patzer_peasantmob(const castorder * co) rsetpeasants(r, rpeasants(r) - n); assert(rpeasants(r) >= 0); - u = - create_unit(r, f, n, get_race(RC_PEASANT), 0, LOC(f->locale, "angry_mob"), - NULL); + u = create_unit(r, f, n, get_race(RC_PEASANT), 0, + LOC(f->locale, "angry_mob"), NULL); fset(u, UFL_ISNEW); unit_addorder(u, create_order(K_GUARD, lang, NULL)); set_order(&u->thisorder, default_order(lang)); diff --git a/src/util/param.c b/src/util/param.c index 31066a4a9..0c486ce5a 100644 --- a/src/util/param.c +++ b/src/util/param.c @@ -106,10 +106,9 @@ param_t findparam_block(const char *s, const struct locale *lang, bool any_local bool isparam(const char *s, const struct locale * lang, param_t param) { - assert(s); assert(param != P_GEBAEUDE); assert(param != P_BUILDING); - if (s[0] > '@') { + if (s && s[0] > '@') { param_t p = findparam(s, lang); return p == param; }