From 0a997cadcd9c9a74d23c2c43524c2b27d189e758 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 27 Jun 2007 01:03:46 +0000 Subject: [PATCH] compilation fixes --- src/common/kernel/build.c | 2 -- src/common/kernel/building.c | 35 ++++++++++++++++++----------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index e12e5919d..9787aefa5 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -815,7 +815,6 @@ build_building(unit * u, const building_type * btype, int want, order * ord) int n = want, built = 0, id; building * b = NULL; /* einmalige Korrektur */ - static char buffer[8 + IDSIZE + 1 + NAMESIZE + 1]; const xmlChar * btname; order * new_order = NULL; const struct locale * lang = u->faction->locale; @@ -994,7 +993,6 @@ build_ship(unit * u, ship * sh, int want) void create_ship(region * r, unit * u, const struct ship_type * newtype, int want, order * ord) { - static char buffer[IDSIZE + 2 * KEYWORDSIZE + 3]; ship *sh; int msize; const construction * cons = newtype->construction; diff --git a/src/common/kernel/building.c b/src/common/kernel/building.c index 4e8018687..4cb883446 100644 --- a/src/common/kernel/building.c +++ b/src/common/kernel/building.c @@ -430,24 +430,25 @@ add_buildinglist(building_list **blist, building *b) building * new_building(const struct building_type * btype, region * r, const struct locale * lang) { - building *b = (building *) calloc(1, sizeof(building)); + building *b = (building *) calloc(1, sizeof(building)); - b->no = newcontainerid(); - bhash(b); - - b->type = btype; - b->region = r; - addlist(&r->buildings, b); - - { - static char buffer[IDSIZE + 1 + NAMESIZE + 1]; - if (b->type->name) - sprintf(buffer, "%s", locale_string(lang, btype->_name)); - else - sprintf(buffer, "%s", LOC(lang, buildingtype(btype, b, 0))); - set_string(&b->name, buffer); - } - return b; + b->no = newcontainerid(); + bhash(b); + + b->type = btype; + b->region = r; + addlist(&r->buildings, b); + + { + const xmlChar * bname; + if (b->type->name==NULL) { + bname = LOC(lang, btype->_name); + } else { + bname = LOC(lang, buildingtype(btype, b, 0)); + } + set_string(&b->name, bname); + } + return b; } void