]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix scanf format string [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 14 Jan 2014 17:00:14 +0000 (18:00 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 14 Jan 2014 17:00:14 +0000 (18:00 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_parse.c

index 9246d420bd4315453ffdf38c4357401255e837c9..b72d9b343e4249c24c3b176a55a7a3c9eaa5920e 100644 (file)
@@ -127,8 +127,8 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
        unsigned int maj, min;
        char *fstype = NULL, *src = NULL, *p;
 
-       rc = sscanf(s,  "%u "           /* (1) id */
-                       "%u "           /* (2) parent */
+       rc = sscanf(s,  "%d "           /* (1) id */
+                       "%d "           /* (2) parent */
                        "%u:%u "        /* (3) maj:min */
                        UL_SCNsA" "     /* (4) mountroot */
                        UL_SCNsA" "     /* (5) target */
@@ -272,8 +272,8 @@ static int mnt_parse_swaps_line(struct libmnt_fs *fs, char *s)
 
        rc = sscanf(s,  UL_SCNsA" "     /* (1) source */
                        UL_SCNsA" "     /* (2) type */
-                       "%jd"           /* (3) size */
-                       "%jd"           /* (4) used */
+                       "%ju"           /* (3) size */
+                       "%ju"           /* (4) used */
                        "%d",           /* priority */
 
                        &src,