aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi/mi-main.c')
-rw-r--r--gdb/mi/mi-main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 0e99fa39bdd..c14897a5f71 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -696,8 +696,9 @@ output_cores (struct ui_out *uiout, const char *field_name, const char *xcores)
ui_out_emit_list list_emitter (uiout, field_name);
auto cores = make_unique_xstrdup (xcores);
char *p = cores.get ();
+ char *saveptr;
- for (p = strtok (p, ","); p; p = strtok (NULL, ","))
+ for (p = strtok_r (p, ",", &saveptr); p; p = strtok_r (NULL, ",", &saveptr))
uiout->field_string (NULL, p);
}