[parted-devel] [PATCH 10/24] linux: Fix gcc complains about signed sccanf variables

Brian C. Lane bcl at redhat.com
Sat Nov 14 00:11:53 GMT 2020


---
 libparted/arch/linux.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 09ec781..4c17720 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -720,9 +720,9 @@ _get_linux_version ()
         static int kver = -1;
 
         struct utsname uts;
-        int major = 0;
-        int minor = 0;
-        int teeny = 0;
+        unsigned int major = 0;
+        unsigned int minor = 0;
+        unsigned int teeny = 0;
 
         if (kver != -1)
                 return kver;
@@ -2884,7 +2884,7 @@ _dm_get_partition_start_and_length(PedPartition const *part,
         char *params;
         char *target_type;
         dm_get_next_target(task, NULL, (uint64_t *)start, (uint64_t *)length, &target_type, &params);
-        if (sscanf (params, "%d:%d %Ld", &major, &minor, start) != 3)
+        if (sscanf (params, "%d:%d %Lu", &major, &minor, start) != 3)
                 goto err;
         rc = 1;
 
-- 
2.26.2




More information about the parted-devel mailing list