diff --git a/src/client/input/keys.c b/src/client/input/keys.c index 1aae39a3..74a7ad1f 100644 --- a/src/client/input/keys.c +++ b/src/client/input/keys.c @@ -248,7 +248,7 @@ void Key_Console (int key) { int i; - strtok( cbd, "\n\r\b" ); + strsep( &cbd, "\n\r\b" ); i = (int)strlen( cbd ); if ( i + key_linepos >= MAXCMDLINE - 1) diff --git a/src/client/menu/qmenu.c b/src/client/menu/qmenu.c index 89bba045..6575b65d 100644 --- a/src/client/menu/qmenu.c +++ b/src/client/menu/qmenu.c @@ -198,7 +198,7 @@ qboolean Field_Key( menufield_s *f, int key ) if ( ( cbd = Sys_GetClipboardData() ) != 0 ) { - strtok( cbd, "\n\r\b" ); + strsep( &cbd, "\n\r\b" ); strncpy( f->buffer, cbd, f->length - 1 ); f->cursor = (int)strlen( f->buffer ); diff --git a/src/client/sound/snd_ogg.c b/src/client/sound/snd_ogg.c index 6ddd6629..97d2061d 100644 --- a/src/client/sound/snd_ogg.c +++ b/src/client/sound/snd_ogg.c @@ -307,9 +307,9 @@ void OGG_LoadPlaylist(char *playlist) } /* Count the files in playlist. */ - for (ptr = strtok((char *)buffer, "\n"); + for (ptr = strsep((char **) &buffer, "\n"); ptr != NULL; - ptr = strtok(NULL, "\n")) { + ptr = strsep(NULL, "\n")) { if ((byte *)ptr != buffer) ptr[-1] = '\n'; if (OGG_Check(va("%s/%s", OGG_DIR, ptr))) @@ -320,9 +320,9 @@ void OGG_LoadPlaylist(char *playlist) ogg_filelist = malloc(sizeof(char *) * ogg_numfiles); i = 0; - for (ptr = strtok((char *)buffer, "\n"); + for (ptr = strsep((char **) &buffer, "\n"); ptr != NULL; - ptr = strtok(NULL, "\n")) + ptr = strsep(NULL, "\n")) if (OGG_Check(va("%s/%s", OGG_DIR, ptr))) ogg_filelist[i++] = strdup(va("%s/%s", OGG_DIR, ptr));