]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: parthelper: Use if/else instead of ternary operator
authorPeter Krempa <pkrempa@redhat.com>
Tue, 17 Jun 2025 08:29:05 +0000 (10:29 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 18 Jun 2025 10:14:32 +0000 (12:14 +0200)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/storage/parthelper.c

index 1169ebfb64d1c705f2ea95dcf409d794dca92fbd..94aac34f7c1bf4b517fa1986390fa25d205fd8db 100644 (file)
@@ -95,8 +95,11 @@ int main(int argc, char **argv)
         if (virFileResolveLink(path, &canonical_path) != 0)
             return 2;
 
-        partsep = *canonical_path &&
-            g_ascii_isdigit(canonical_path[strlen(canonical_path)-1]) ? "p" : "";
+        if (*canonical_path &&
+            g_ascii_isdigit(canonical_path[strlen(canonical_path)-1]))
+            partsep = "p";
+        else
+            partsep = "";
     }
 
     if ((dev = ped_device_get(path)) == NULL) {