From ec2295219d5aa69c6f21f4752d21508e3313e5a0 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 24 Jul 2021 23:44:24 +0200 Subject: [PATCH] 3rd arg of Z is bitfield --- DCCEXParser.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 29e7074..a2086c9 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -578,12 +578,10 @@ bool DCCEXParser::parseZ(Print *stream, int16_t params, int16_t p[]) } return true; - case 3: // - if (p[0] < 0) - return false; - if (p[1] > 255 || p[1] < 0) - return false; - if (!(p[2] == 0 || p[2] == 1)) + case 3: // + if (p[0] < 0 || + p[1] > 255 || p[1] < 0 || + p[2] < 0 || p[2] > 7 ) return false; if (!Output::create(p[0], p[1], p[2], 1)) return false;