[PATCH 4/6] storage: parthelper: Use if/else instead of ternary operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Peter Krempa <pkrempa@xxxxxxxxxx>

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/storage/parthelper.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c
index 1169ebfb64..94aac34f7c 100644
--- a/src/storage/parthelper.c
+++ b/src/storage/parthelper.c
@@ -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) {
-- 
2.49.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux