Skip to content

Commit

Permalink
Convert strtok->strtok_r in util-nvctrl.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Aug 28, 2011
1 parent 393db20 commit f007e16
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mythtv/libs/libmythui/util-nvctrl.cpp
Expand Up @@ -187,9 +187,10 @@ int GetNvidiaRates(t_screenrate& screenmap)

/* split the MetaMode string by comma */

for (modeString = strtok(tmp, ",");
char *strtok_state = NULL;
for (modeString = strtok_r(tmp, ",", &strtok_state);
modeString;
modeString = strtok(NULL, ","))
modeString = strtok_r(NULL, ",", &strtok_state))
{
/*
* retrieve the modeName and display device mask
Expand Down Expand Up @@ -227,9 +228,9 @@ int GetNvidiaRates(t_screenrate& screenmap)
while (*tmp == ' ')
tmp++;
i = 0;
for (modeString = strtok(tmp, " ");
for (modeString = strtok_r(tmp, " ", &strtok_state);
modeString;
modeString = strtok(NULL, " "))
modeString = strtok_r(NULL, " ", &strtok_state))
{
buf[i++] = modeString;
}
Expand Down

0 comments on commit f007e16

Please sign in to comment.