Skip to content

Commit

Permalink
back to strdup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Singer committed Sep 17, 2024
1 parent 5308b8d commit 8b1069c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions runtime/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,14 @@ 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",
strerror(errno)
);
return alert_level;
}
strcpy(alert_csv_cpy, alert_csv);

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

Expand Down

0 comments on commit 8b1069c

Please sign in to comment.