Fix cpplint: Replace strtok by strtok_r
This commit is contained in:
parent
2a71be06ab
commit
76bf5ec69b
@ -90,10 +90,11 @@ void MqttSettingsClass::onMqttMessage(const espMqttClientTypes::MessagePropertie
|
||||
char* serial_str;
|
||||
char* subtopic;
|
||||
char* setting;
|
||||
char* rest = &token_topic[strlen(config.Mqtt_Topic)];
|
||||
|
||||
serial_str = strtok(&token_topic[strlen(config.Mqtt_Topic)], "/");
|
||||
subtopic = strtok(NULL, "/");
|
||||
setting = strtok(NULL, "/");
|
||||
serial_str = strtok_r(rest, "/", &rest);
|
||||
subtopic = strtok_r(rest, "/", &rest);
|
||||
setting = strtok_r(rest, "/", &rest);
|
||||
|
||||
if (serial_str == NULL || subtopic == NULL || setting == NULL) {
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user