erofs-utils: errno shouldn't set to a negative value in lib/tar.c
authorErik Sjölund <erik.sjolund@gmail.com>
Mon, 2 Oct 2023 17:36:08 +0000 (19:36 +0200)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Sat, 7 Oct 2023 23:42:30 +0000 (07:42 +0800)
`errno` should be set to a non-negative value here.

Link: https://lore.kernel.org/r/CAB+1q0Q3+7s1Lt8uW6DWZ7vfjhEKhG7O7MAQhCuH-C10cr9F4g@mail.gmail.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
lib/tar.c

index 074497247adaab63c1515bd50585ea5988a3a0fd..8204939276a40f5ceefad2ba9988def2db0b2048 100644 (file)
--- a/lib/tar.c
+++ b/lib/tar.c
@@ -241,7 +241,7 @@ static long long tarerofs_otoi(const char *ptr, int len)
        val = strtol(ptr, &endp, 8);
        if ((!val && endp == inp) |
             (*endp && *endp != ' '))
-               errno = -EINVAL;
+               errno = EINVAL;
        return val;
 }