Skip to content

Commit 8b1069c

Browse files
author
Kyle Singer
committed
back to strdup
1 parent 5308b8d commit 8b1069c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

runtime/debug.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,14 @@ static int parse_alert_level_csv(const char *const alert_csv) {
125125

126126
// strtok modifies the passed in string, so copy alert_csv and use
127127
// the copy instead
128-
char *alert_csv_cpy = malloc(csv_len + 1);
128+
char *alert_csv_cpy = strdup(alert_csv);
129129
if (!alert_csv_cpy) {
130130
// Non-critical error, so just print a warning
131131
fprintf(stderr, "Cilk: unable to copy CILK_ALERT settings (%s)\n",
132132
strerror(errno)
133133
);
134134
return alert_level;
135135
}
136-
strcpy(alert_csv_cpy, alert_csv);
137136

138137
char *alert_str = strtok(alert_csv_cpy, ",");
139138

0 commit comments

Comments
 (0)