]> git.ipfire.org Git - pakfire.git/commitdiff
deps: Simplify checking for valid inputs
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Oct 2024 15:59:43 +0000 (15:59 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Oct 2024 15:59:43 +0000 (15:59 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/deps.c

index ac71234123badcd705689d5e88c48df56254bd76..b06493bae7d5232402403f36a3f129b4e5ac9b05 100644 (file)
@@ -327,13 +327,7 @@ Id pakfire_str2dep(struct pakfire* pakfire, const char* dep) {
        Id id = ID_NULL;
 
        // Invalid input
-       if (!dep) {
-               errno = EINVAL;
-               return id;
-       }
-
-       // Ignore empty strings
-       if (!*dep)
+       if (!dep || !*dep)
                return id;
 
        const char* s = dep;