Skip to content

Commit

Permalink
fixed error in string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
duncan-brown committed Jun 2, 2020
1 parent 286d7aa commit 27fd8d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,16 @@ void processConfig() {
return processConfigError();
}

float tzoffset = strtof(server.arg("brewstatusTZoffset").c_str(), nullptr, 10);
float tzoffset = strtof(server.arg("brewstatusTZoffset").c_str(), nullptr);
if(tzoffset < -12.0) {
Serial.println("brewstatusTZoffset is less than -12!");
return processConfigError();
} else if(tzoffset > 12.0) {
Serial.println("brewstatusTZoffset is greater than 12!");
return processConfigError();
else
} else {
app_config.config["brewstatusTZoffset"] = tzoffset;
}
Serial.println("Updated brewstatusTZoffset");
}

Expand Down

0 comments on commit 27fd8d7

Please sign in to comment.