From: Peter Krempa Date: Tue, 17 Jun 2025 08:29:05 +0000 (+0200) Subject: storage: parthelper: Use if/else instead of ternary operator X-Git-Tag: v11.5.0-rc1~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=550c32b17214090eb7ab2d6500c18d2c39d324b2;p=thirdparty%2Flibvirt.git storage: parthelper: Use if/else instead of ternary operator Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik Reviewed-by: Ján Tomko --- 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) {