From f9bced467d0ab4f558020388fdbf9de0d6150a11 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 8 Feb 2015 10:33:45 +0100 Subject: [PATCH 1/2] fix a crash in rename_cmd --- src/laws.c | 5 ++++- src/tests.c | 2 +- src/util/language.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/laws.c b/src/laws.c index acb15e747..7fc04876b 100755 --- a/src/laws.c +++ b/src/laws.c @@ -1896,7 +1896,10 @@ int name_cmd(struct unit *u, struct order *ord) } if (s != NULL) { - return rename_cmd(u, ord, s, getstrtoken()); + const char *name = getstrtoken(); + if (name) { + rename_cmd(u, ord, s, name); + } } return 0; diff --git a/src/tests.c b/src/tests.c index 108cde2a4..10eefd9c4 100644 --- a/src/tests.c +++ b/src/tests.c @@ -240,7 +240,7 @@ const message_type *register_msg(const char *type, int n_param, ...) { void assert_messages(struct CuTest * tc, struct mlist *msglist, const message_type **types, int num_msgs, bool exact_match, ...) { va_list args; - int found, argc; + int found, argc = -1; struct message *msg; bool match = true; diff --git a/src/util/language.c b/src/util/language.c index ec83b98b9..677832636 100644 --- a/src/util/language.c +++ b/src/util/language.c @@ -263,6 +263,7 @@ void init_translations(const struct locale *lang, int ut, const char * (*string_ assert(maxstrings > 0); tokens = get_translations(lang, ut); for (i = 0; i != maxstrings; ++i) { + // TODO: swap the name of s and key const char * s = string_cb(i); const char * key = s ? locale_string(lang, s, false) : 0; key = key ? key : s; From 954a649d3fa484b3fc8c6bc365c15dffa55ada31 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 8 Feb 2015 10:41:05 +0100 Subject: [PATCH 2/2] version number bump --- src/buildno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buildno.h b/src/buildno.h index 008d66547..69c61645e 100644 --- a/src/buildno.h +++ b/src/buildno.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 4 -#define VERSION_BUILD 698 +#define VERSION_BUILD 1