From 177f8f52881007a5ed6696880537767fdebc6a46 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 13 Oct 2015 13:32:27 +0200 Subject: [PATCH] re-enable a test that supposedly breaks on travis (find out why) fix a potential null-pointer crash in rename_cmd --- src/laws.c | 2 +- src/laws.test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/laws.c b/src/laws.c index ba5466fda..549acb2b2 100755 --- a/src/laws.c +++ b/src/laws.c @@ -1622,7 +1622,7 @@ bool renamed_building(const building * b) static int rename_cmd(unit * u, order * ord, char **s, const char *s2) { - if (!s2[0]) { + if (!s2 || !s2[0]) { cmistake(u, ord, 84, MSG_EVENT); return 0; } diff --git a/src/laws.test.c b/src/laws.test.c index c7c3bf632..7b733b9cf 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -1135,7 +1135,7 @@ CuSuite *get_laws_suite(void) SUITE_ADD_TEST(suite, test_mail_faction_no_msg); SUITE_ADD_TEST(suite, test_mail_region_no_msg); SUITE_ADD_TEST(suite, test_mail_faction_no_target); - (void)test_luck_message; /* disabled, breaks on travis */ + SUITE_ADD_TEST(suite, test_luck_message); return suite; }