From 8b1069c8cdf2ddfb4e286a7fa70e60943a31f06a Mon Sep 17 00:00:00 2001 From: Kyle Singer Date: Tue, 17 Sep 2024 15:50:31 -0500 Subject: [PATCH] back to strdup --- runtime/debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/debug.c b/runtime/debug.c index ebd5707a..316ce6ce 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -125,7 +125,7 @@ static int parse_alert_level_csv(const char *const alert_csv) { // strtok modifies the passed in string, so copy alert_csv and use // the copy instead - char *alert_csv_cpy = malloc(csv_len + 1); + char *alert_csv_cpy = strdup(alert_csv); if (!alert_csv_cpy) { // Non-critical error, so just print a warning fprintf(stderr, "Cilk: unable to copy CILK_ALERT settings (%s)\n", @@ -133,7 +133,6 @@ static int parse_alert_level_csv(const char *const alert_csv) { ); return alert_level; } - strcpy(alert_csv_cpy, alert_csv); char *alert_str = strtok(alert_csv_cpy, ",");