mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-23 04:52:07 +00:00
strtok ist seit Jahren durch strsep ersetzt. Es ist schneller und
besser.
This commit is contained in:
parent
d84f0fce34
commit
6669ab3643
3 changed files with 6 additions and 6 deletions
|
@ -248,7 +248,7 @@ void Key_Console (int key)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
strtok( cbd, "\n\r\b" );
|
strsep( &cbd, "\n\r\b" );
|
||||||
|
|
||||||
i = (int)strlen( cbd );
|
i = (int)strlen( cbd );
|
||||||
if ( i + key_linepos >= MAXCMDLINE - 1)
|
if ( i + key_linepos >= MAXCMDLINE - 1)
|
||||||
|
|
|
@ -198,7 +198,7 @@ qboolean Field_Key( menufield_s *f, int key )
|
||||||
|
|
||||||
if ( ( cbd = Sys_GetClipboardData() ) != 0 )
|
if ( ( cbd = Sys_GetClipboardData() ) != 0 )
|
||||||
{
|
{
|
||||||
strtok( cbd, "\n\r\b" );
|
strsep( &cbd, "\n\r\b" );
|
||||||
|
|
||||||
strncpy( f->buffer, cbd, f->length - 1 );
|
strncpy( f->buffer, cbd, f->length - 1 );
|
||||||
f->cursor = (int)strlen( f->buffer );
|
f->cursor = (int)strlen( f->buffer );
|
||||||
|
|
|
@ -307,9 +307,9 @@ void OGG_LoadPlaylist(char *playlist)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Count the files in playlist. */
|
/* Count the files in playlist. */
|
||||||
for (ptr = strtok((char *)buffer, "\n");
|
for (ptr = strsep((char **) &buffer, "\n");
|
||||||
ptr != NULL;
|
ptr != NULL;
|
||||||
ptr = strtok(NULL, "\n")) {
|
ptr = strsep(NULL, "\n")) {
|
||||||
if ((byte *)ptr != buffer)
|
if ((byte *)ptr != buffer)
|
||||||
ptr[-1] = '\n';
|
ptr[-1] = '\n';
|
||||||
if (OGG_Check(va("%s/%s", OGG_DIR, ptr)))
|
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);
|
ogg_filelist = malloc(sizeof(char *) * ogg_numfiles);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (ptr = strtok((char *)buffer, "\n");
|
for (ptr = strsep((char **) &buffer, "\n");
|
||||||
ptr != NULL;
|
ptr != NULL;
|
||||||
ptr = strtok(NULL, "\n"))
|
ptr = strsep(NULL, "\n"))
|
||||||
if (OGG_Check(va("%s/%s", OGG_DIR, ptr)))
|
if (OGG_Check(va("%s/%s", OGG_DIR, ptr)))
|
||||||
ogg_filelist[i++] = strdup(va("%s/%s", OGG_DIR, ptr));
|
ogg_filelist[i++] = strdup(va("%s/%s", OGG_DIR, ptr));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue