diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 2e76f2dfb..e42554560 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -1109,7 +1109,7 @@ restart(unit * u, struct order * ord) } static boolean -EnhancedQuit() +EnhancedQuit(void) { static int value = -1; if (value<0) { diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 07267a83f..825fe6e85 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -146,15 +146,16 @@ AllianceAuto(void) { static int value = -1; if (value<0) { - char * str = strdup(get_param(global.parameters, "alliance.auto")); + const char * str = get_param(global.parameters, "alliance.auto"); value = 0; if (str!=NULL) { - char * tok = strtok(str, " "); + char * sstr = strdup(str); + char * tok = strtok(sstr, " "); while (tok) { value |= ally_flag(tok); tok = strtok(NULL, " "); } - free(str); + free(sstr); } } return value; @@ -165,15 +166,16 @@ AllianceRestricted(void) { static int value = -1; if (value<0) { - char * str = strdup(get_param(global.parameters, "alliance.restricted")); + const char * str = get_param(global.parameters, "alliance.restricted"); value = 0; if (str!=NULL) { - char * tok = strtok(str, " "); + char * sstr = strdup(str); + char * tok = strtok(sstr, " "); while (tok) { value |= ally_flag(tok); tok = strtok(NULL, " "); } - free(str); + free(sstr); } } return value; diff --git a/src/mapper/map_partei.c b/src/mapper/map_partei.c index f617d75e9..67b15f181 100644 --- a/src/mapper/map_partei.c +++ b/src/mapper/map_partei.c @@ -228,16 +228,16 @@ seed_dropouts(void) void read_newfactions(const char * filename) { - FILE * F = fopen(filename, "r"); - if (F==NULL) return; - for (;;) { - faction * f = factions; - char race[20], email[64], lang[8], password[16]; - newfaction *nf; - int bonus, subscription; - + FILE * F = fopen(filename, "r"); + if (F==NULL) return; + for (;;) { + faction * f = factions; + char race[20], email[64], lang[8], password[16]; + newfaction *nf; + int bonus, subscription; + int alliance; + if (alliances!=NULL) { - int alliance; /* email;race;locale;startbonus;subscription;alliance */ if (fscanf(F, "%s %s %s %d %d %s %d", email, race, lang, &bonus, &subscription, password, &alliance)<=0) break; } else {