- while ((current = smpi_colors[i])){
- if (strcmp (state, current) == 0){ ret = smpi_colors[i+1]; break; } //exact match
- if (strstr(target, current)) { ret = smpi_colors[i+1]; break; }; //as substring
+ const char *current = smpi_colors[i];
+ while ((current != nullptr)){
+ if (strcmp (state, current) == 0 //exact match
+ || strstr(target, current) != 0 ){//as substring
+ ret = smpi_colors[i+1];
+ break;
+ }