From 1bcb841fcb42c72dc2844a0ca0b9369dc0a68dd2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 21 Apr 2002 11:39:47 +0000 Subject: [PATCH] bugfix strnzcpy bugfix regatta --- src/config.h | 2 +- src/eressea/korrektur.c | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/config.h b/src/config.h index b3ed26380..3881cca55 100644 --- a/src/config.h +++ b/src/config.h @@ -244,6 +244,6 @@ extern char * strdup(const char *s); #ifdef STRNCPY_HAS_ZEROTERMINATION # define strnzcpy(dst, src, len) strncpy(dst, src, len) #else -# define strnzcpy(dst, src, len) for(;;) { strncpy(dst, src, len); if (len) dst[len-1]=0; break; } +# define strnzcpy(dst, src, len) (strncpy(dst, src, len), len?dst[len-1]=0:0, dst) #endif #endif diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 9cc6bdeef..735e69cea 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -2647,24 +2647,15 @@ fix_astralplane(void) static int fix_watchers(void) { - plane * p = getplanebyid (59034966); + plane * p = getplanebyid (1094969858); if (p) { - faction * f = findfaction(atoi36("gm04")); + faction * f = findfaction(atoi36("rega")); watcher * w = calloc(sizeof(watcher), 1); w->faction = f; w->mode = see_unit; w->next = p->watchers; p->watchers = w; } - p = getplanebyid(1137); - if (p) { - faction * f = findfaction(atoi36("rr")); - watcher * w = calloc(sizeof(watcher), 1); - w->faction = f; - w->mode = see_unit; - w->next = p->watchers; - p->watchers = w; - } return 0; } @@ -2752,7 +2743,7 @@ korrektur(void) /* fix_unitrefs(); */ stats(); do_once("sql2", dump_sql()); - do_once("fw01", fix_watchers()); + do_once("fw02", fix_watchers()); do_once("fxh2", fix_plainherbs()); #if NEW_RESOURCEGROWTH /* do not remove do_once calls - old datafiles need them! */