From 8003638f306b784e609e263352132dec99c16a32 Mon Sep 17 00:00:00 2001 From: cpickett Date: Fri, 21 Mar 2008 20:44:52 +0000 Subject: [PATCH] * call strdup on result from strsignal to avoid clobbering it * add Torok Edwin to AUTHORS git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@431 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- AUTHORS | 3 ++- tests/check_check_master.c | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index d24580e..b70b0e3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,7 +14,8 @@ Patches: Bernhard Reiter (configure issues) Robert Lemmen (gcov description in manual) Loic Martin (AM_PATH_CHECK patch) Ross Burton (pkg-config patch) - Roland Stigge (bug fix) + Roland Stigge (bug fix: allow fail inside setup) + Torok Edwin (strsignal and build fixes) Anybody who has contributed code to Check or Check's build system is considered an author. Send patches to this file to diff --git a/tests/check_check_master.c b/tests/check_check_master.c index 72a2a6e..2dbeb6f 100644 --- a/tests/check_check_master.c +++ b/tests/check_check_master.c @@ -311,13 +311,17 @@ Suite *make_master_suite (void) static void init_signal_strings(void) { + char *s8 = strdup(strsignal(8)); + char *s11 = strdup(strsignal(11)); int n; - n = snprintf(signal_11_str, SIG_STR_LEN, "Received signal 11 (%s)", strsignal(11)); + n = snprintf(signal_11_str, SIG_STR_LEN, "Received signal 11 (%s)", s11); assert(n < SIG_STR_LEN); - n = snprintf(signal_11_8_str, SIG_STR_LEN, "Received signal 11 (%s), expected 8 (%s)", strsignal(11), strsignal(8)); + n = snprintf(signal_11_8_str, SIG_STR_LEN, "Received signal 11 (%s), expected 8 (%s)", s11, s8); assert(n < SIG_STR_LEN); - n = snprintf(signal_8_str, SIG_STR_LEN, "Received signal 8 (%s)", strsignal(8)); + n = snprintf(signal_8_str, SIG_STR_LEN, "Received signal 8 (%s)", s8); assert(n < SIG_STR_LEN); + free(s8); + free(s11); } void setup (void) -- 2.40.0