No need to use the re-entrant strtok_r and mingw32 doesn't support it anyway.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
diff --git a/main.c b/main.c
index 3dc70b8..355ab1b 100644
--- a/main.c
+++ b/main.c
@@ -1116,9 +1116,9 @@ static char *set_schedtime(const char *arg, struct schedtime *st)
static char *set_gpu_engine(char *arg)
{
int i, val = 0, device = 0;
- char *saveptr = NULL, *nextptr;
+ char *nextptr;
- nextptr = strtok_r(arg, ",", &saveptr);
+ nextptr = strtok(arg, ",");
if (nextptr == NULL)
return "Invalid parameters for set gpu engine";
val = atoi(nextptr);
@@ -1127,7 +1127,7 @@ static char *set_gpu_engine(char *arg)
gpus[device++].gpu_engine = val;
- while ((nextptr = strtok_r(NULL, ",", &saveptr)) != NULL) {
+ while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
if (val <= 0 || val >= 9999)
return "Invalid value passed to set_gpu_engine";
@@ -1143,9 +1143,9 @@ static char *set_gpu_engine(char *arg)
static char *set_gpu_fan(char *arg)
{
int i, val = 0, device = 0;
- char *saveptr = NULL, *nextptr;
+ char *nextptr;
- nextptr = strtok_r(arg, ",", &saveptr);
+ nextptr = strtok(arg, ",");
if (nextptr == NULL)
return "Invalid parameters for set gpu fan";
val = atoi(nextptr);
@@ -1154,7 +1154,7 @@ static char *set_gpu_fan(char *arg)
gpus[device++].gpu_fan = val;
- while ((nextptr = strtok_r(NULL, ",", &saveptr)) != NULL) {
+ while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
if (val < 0 || val > 100)
return "Invalid value passed to set_gpu_fan";
@@ -1170,9 +1170,9 @@ static char *set_gpu_fan(char *arg)
static char *set_gpu_memclock(char *arg)
{
int i, val = 0, device = 0;
- char *saveptr = NULL, *nextptr;
+ char *nextptr;
- nextptr = strtok_r(arg, ",", &saveptr);
+ nextptr = strtok(arg, ",");
if (nextptr == NULL)
return "Invalid parameters for set gpu memclock";
val = atoi(nextptr);
@@ -1181,7 +1181,7 @@ static char *set_gpu_memclock(char *arg)
gpus[device++].gpu_memclock = val;
- while ((nextptr = strtok_r(NULL, ",", &saveptr)) != NULL) {
+ while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
if (val <= 0 || val >= 9999)
return "Invalid value passed to set_gpu_memclock";
@@ -1197,9 +1197,9 @@ static char *set_gpu_memclock(char *arg)
static char *set_gpu_powertune(char *arg)
{
int i, val = 0, device = 0;
- char *saveptr = NULL, *nextptr;
+ char *nextptr;
- nextptr = strtok_r(arg, ",", &saveptr);
+ nextptr = strtok(arg, ",");
if (nextptr == NULL)
return "Invalid parameters for set gpu powertune";
val = atoi(nextptr);
@@ -1208,7 +1208,7 @@ static char *set_gpu_powertune(char *arg)
gpus[device++].gpu_powertune = val;
- while ((nextptr = strtok_r(NULL, ",", &saveptr)) != NULL) {
+ while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
if (val < -99 || val > 99)
return "Invalid value passed to set_gpu_powertune";
@@ -1225,9 +1225,9 @@ static char *set_gpu_vddc(char *arg)
{
int i, device = 0;
float val = 0;
- char *saveptr = NULL, *nextptr;
+ char *nextptr;
- nextptr = strtok_r(arg, ",", &saveptr);
+ nextptr = strtok(arg, ",");
if (nextptr == NULL)
return "Invalid parameters for set gpu vddc";
val = atof(nextptr);
@@ -1236,7 +1236,7 @@ static char *set_gpu_vddc(char *arg)
gpus[device++].gpu_vddc = val;
- while ((nextptr = strtok_r(NULL, ",", &saveptr)) != NULL) {
+ while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
if (val <= 0 || val >= 9999)
return "Invalid value passed to set_gpu_vddc";