Gap bugfix.

This commit is contained in:
Blaz Kristan 2021-10-22 21:36:54 +02:00
parent 31bf615fe8
commit 4bb30deca6

View File

@ -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;