From 9340cfa9a1409d3ffb69086d1c3da41acdef7592 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 27 Dec 2019 23:01:10 +0300 Subject: [PATCH] SDL_x11events.c (X11_DispatchEvent): remove FIXME and use SDL_strtokr(). --- src/video/x11/SDL_x11events.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 1fecb90a1..22e601efa 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1346,9 +1346,9 @@ X11_DispatchEvent(_THIS) X11_ReadProperty(&p, display, data->xwindow, videodata->PRIMARY); if (p.format == 8) { - /* !!! FIXME: don't use strtok here. It's not reentrant and not in SDL_stdinc. */ + char* saveptr = NULL; char* name = X11_XGetAtomName(display, target); - char *token = strtok((char *) p.data, "\r\n"); + char *token = SDL_strtokr((char *) p.data, "\r\n", &saveptr); while (token != NULL) { if (SDL_strcmp("text/plain", name)==0) { SDL_SendDropText(data->window, token); @@ -1358,7 +1358,7 @@ X11_DispatchEvent(_THIS) SDL_SendDropFile(data->window, fn); } } - token = strtok(NULL, "\r\n"); + token = SDL_strtokr(NULL, "\r\n", &saveptr); } SDL_SendDropComplete(data->window); }