From cc7df7c302d197251b82de76d5f197bf99fc8f7f Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Tue, 18 Oct 2022 21:13:39 +0200 Subject: [PATCH] Removed senseless checks uint can never by smaller than 0 --- src/WebApi_ntp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WebApi_ntp.cpp b/src/WebApi_ntp.cpp index 47726d6..48bcb6c 100644 --- a/src/WebApi_ntp.cpp +++ b/src/WebApi_ntp.cpp @@ -228,21 +228,21 @@ void WebApiNtpClass::onNtpTimePost(AsyncWebServerRequest* request) return; } - if (root[F("hour")].as() < 0 || root[F("hour")].as() > 23) { + if (root[F("hour")].as() > 23) { retMsg[F("message")] = F("Hour must be a number between 0 and 23!"); response->setLength(); request->send(response); return; } - if (root[F("minute")].as() < 0 || root[F("minute")].as() > 59) { + if (root[F("minute")].as() > 59) { retMsg[F("message")] = F("Minute must be a number between 0 and 59!"); response->setLength(); request->send(response); return; } - if (root[F("second")].as() < 0 || root[F("second")].as() > 59) { + if (root[F("second")].as() > 59) { retMsg[F("message")] = F("Second must be a number between 0 and 59!"); response->setLength(); request->send(response);