diff options
author | Oskar <> | 2024-03-22 13:53:00 +0100 |
---|---|---|
committer | Oskar <> | 2024-03-22 13:53:00 +0100 |
commit | 6f162676864f6972c302ecab71e44149fa039551 (patch) | |
tree | c9c33c0f219be8edaff0075c5a29d14acbd6b026 /i_validation.c | |
parent | 55ac4ebe3bed9b112fa553abece277b309c76bb9 (diff) |
vcpm tested, seems OK
Diffstat (limited to 'i_validation.c')
-rw-r--r-- | i_validation.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |