]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
util: which: Fix return code on invalid input
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Jan 2025 11:11:15 +0000 (11:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Jan 2025 11:11:15 +0000 (11:11 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/util.c

index f461b4b37229284bd7830ad233fdee88b2506a49..943b8082647dc134a5de2a31c5ab81c4025b346c 100644 (file)
@@ -347,10 +347,8 @@ int __pakfire_which(struct pakfire* pakfire, char* path, const size_t length,
        int r;
 
        // Check input
-       if (!what) {
-               errno = EINVAL;
-               return 1;
-       }
+       if (!what)
+               return -EINVAL;
 
        static const char* paths[] = {
                "/usr/sbin",