From 6f162676864f6972c302ecab71e44149fa039551 Mon Sep 17 00:00:00 2001 From: Oskar <> Date: Fri, 22 Mar 2024 13:53:00 +0100 Subject: vcpm tested, seems OK --- i_validation.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'i_validation.c') diff --git a/i_validation.c b/i_validation.c index bc52f9c..a21dd48 100644 --- a/i_validation.c +++ b/i_validation.c @@ -19,6 +19,7 @@ _PLUS_CONTINUE (L+ And more numbers after it. Will make validate_plus_continue r _NA (None of these cases) */ char nums[] = "123456789"; + int iflag = _INVALID; if (smode_buf[1] == '+' || smode_buf[1] == '-') { if (smode_buf[2] == '0') { return _INVALID; // Only L0 (invalid) @@ -28,10 +29,16 @@ _NA (None of these cases) } for (int i = 0 ; i < 9 ; i++) { // Check if theres a number after + + iflag = _VALID; if (smode_buf[2] == nums[i]) { return _PLUS_CONTINUE; // if true then continue + } else { + iflag = _INVALID; } } + if (iflag == _INVALID) { + return _INVALID; + } } return _NA; -- cgit v1.2.3