From beffa1d5362002838b97c82c23db1aa5b5720445 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 18 Nov 2019 18:48:28 +0100 Subject: [PATCH] CID 205842: con is never NULL. --- src/kernel/build.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/kernel/build.c b/src/kernel/build.c index d9e1cc8bc..7e97819dc 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -511,14 +511,13 @@ int build_skill(unit *u, int basesk, int skill_mod) { */ static int build_limited(unit * u, const construction * con, int completed, int number, int want, int basesk, int *skill_total) { int skills = *skill_total; - int made = 0, maxsize = con->maxsize * number; + int made = 0, maxsize; + assert(con); if (want <= 0) { return 0; } - if (con == NULL) { - return ENOMATERIALS; - } + maxsize = con->maxsize * number; if (completed == maxsize) { return ECOMPLETE; }