Removed senseless checks
uint can never by smaller than 0
This commit is contained in:
parent
a63659ffbb
commit
cc7df7c302
@ -228,21 +228,21 @@ void WebApiNtpClass::onNtpTimePost(AsyncWebServerRequest* request)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root[F("hour")].as<uint>() < 0 || root[F("hour")].as<uint>() > 23) {
|
if (root[F("hour")].as<uint>() > 23) {
|
||||||
retMsg[F("message")] = F("Hour must be a number between 0 and 23!");
|
retMsg[F("message")] = F("Hour must be a number between 0 and 23!");
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root[F("minute")].as<uint>() < 0 || root[F("minute")].as<uint>() > 59) {
|
if (root[F("minute")].as<uint>() > 59) {
|
||||||
retMsg[F("message")] = F("Minute must be a number between 0 and 59!");
|
retMsg[F("message")] = F("Minute must be a number between 0 and 59!");
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root[F("second")].as<uint>() < 0 || root[F("second")].as<uint>() > 59) {
|
if (root[F("second")].as<uint>() > 59) {
|
||||||
retMsg[F("message")] = F("Second must be a number between 0 and 59!");
|
retMsg[F("message")] = F("Second must be a number between 0 and 59!");
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user