From a3ef37d33cdf0ab5bf80b5c13f2c0f382761417e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 16 Feb 2022 22:27:46 +0100 Subject: Fix check for 0-prefixed integers parameter string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libar2_decode_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libar2_decode_params.c') diff --git a/libar2_decode_params.c b/libar2_decode_params.c index 7707ce4..c42a937 100644 --- a/libar2_decode_params.c +++ b/libar2_decode_params.c @@ -8,7 +8,7 @@ decode_u32(const char *s, uint_least32_t *outp) uint_least32_t digit; size_t i; - if ((s[0] == '0' && s[1] == '0') || !isdigit(s[0])) { + if ((s[0] == '0' && s[1] != '0') || !isdigit(s[0])) { errno = EINVAL; return 0; } -- cgit v1.2.3-70-g09d2