aboutsummaryrefslogtreecommitdiffstats
path: root/libar2_decode_params.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-16 22:27:46 +0100
committerMattias Andrée <maandree@kth.se>2022-02-16 22:27:46 +0100
commita3ef37d33cdf0ab5bf80b5c13f2c0f382761417e (patch)
tree33a2c41a9fe6d98ae9a982b8331b6a2c4b4ab9d0 /libar2_decode_params.c
parentm (diff)
downloadlibar2-a3ef37d33cdf0ab5bf80b5c13f2c0f382761417e.tar.gz
libar2-a3ef37d33cdf0ab5bf80b5c13f2c0f382761417e.tar.bz2
libar2-a3ef37d33cdf0ab5bf80b5c13f2c0f382761417e.tar.xz
Fix check for 0-prefixed integers parameter string
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libar2_decode_params.c')
-rw-r--r--libar2_decode_params.c2
1 files changed, 1 insertions, 1 deletions
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;
}