From 4bb30deca6ce1ae51236cc3918a7bc1f11643485 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Fri, 22 Oct 2021 21:36:54 +0200 Subject: [PATCH] Gap bugfix. --- wled00/set.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/set.cpp b/wled00/set.cpp index e024e6ec..31486387 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -516,9 +516,9 @@ bool updateVal(const String* req, const char* key, byte* val, byte minv, byte ma { // we only have ~ (and perhaps -) if (req->charAt(pos+4) == '-') { - *val = (int)(*val -1) < (int)minv ? maxv : (*val -1); + *val = (int)(*val -1) < (int)minv ? maxv : min((int)maxv,(*val -1)); } else { - *val = (int)(*val +1) > (int)maxv ? minv : (*val +1); + *val = (int)(*val +1) > (int)maxv ? minv : max((int)minv,(*val +1)); } } else { out += *val;