]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-device-manager: Add != 0 to strcmp calls
authorRay Strode <rstrode@redhat.com>
Fri, 25 Nov 2022 16:25:37 +0000 (11:25 -0500)
committerRay Strode <rstrode@redhat.com>
Tue, 29 Nov 2022 14:22:06 +0000 (09:22 -0500)
strcmp is kind of a confusing function in that it returns
non-zero when the strings are not equal. That is
especially counterintuitive when this non-zero value is
treated as a TRUE boolean.

This commit just adds some != 0's to a couple of strcmp
calls for clarity.

src/libply-splash-core/ply-device-manager.c

index fb82c3dc7e0c5b798c49f182ac65dc5bab802440..47ca411992976c0e17cfaeb392c4c19decc5bd04 100644 (file)
@@ -458,7 +458,7 @@ verify_add_or_change (ply_device_manager_t *manager,
 {
         const char *subsystem;
 
-        if (strcmp (action, "add") && strcmp (action, "change"))
+        if (strcmp (action, "add") != 0 && strcmp (action, "change") != 0)
                 return false;
 
         if (manager->local_console_managed && manager->local_console_is_text) {