Use strtok_r not strtok.

This commit is contained in:
Dave Davenport 2014-07-22 08:21:56 +02:00
parent bd4aa3d2fa
commit 3c28012a87
1 changed files with 4 additions and 1 deletions

View File

@ -2042,9 +2042,12 @@ static void config_sanity_check ( void )
static void setup_switchers ( void )
{
char *savept;
char *switcher_str = strdup ( config.switchers );
char *token;
for ( token = strtok ( switcher_str, "," ); token != NULL; token = strtok ( NULL, "," ) ) {
for ( token = strtok_r ( switcher_str, "," ,&savept);
token != NULL;
token = strtok_r ( NULL, ",",&savept ) ) {
if ( strcasecmp ( token, "window" ) == 0 ) {
switchers = (Switcher *) realloc ( switchers, sizeof ( Switcher ) * ( num_switchers + 1 ) );
copy_string ( switchers[num_switchers].name, "window", 32 );