]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslocks: fix maj:min scanf
authorKarel Zak <kzak@redhat.com>
Mon, 28 Mar 2022 09:39:27 +0000 (11:39 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 28 Mar 2022 09:39:27 +0000 (11:39 +0200)
Fixes: https://github.com/util-linux/util-linux/issues/1633
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lslocks.c

index cb713c7473c59da5a01ace0122e905f85950b0ab..caca13f9a9c3c5e40fd8d7b5077ef98fe73867c9 100644 (file)
@@ -230,7 +230,7 @@ static ino_t get_dev_inode(char *str, dev_t *dev)
        unsigned int maj = 0, min = 0;
        ino_t inum = 0;
 
-       if (sscanf(str, "%02x:%02x:%ju", &maj, &min, &inum) != 3)
+       if (sscanf(str, "%x:%x:%ju", &maj, &min, &inum) != 3)
                errx(EXIT_FAILURE, _("failed to parse '%s'"), str);
 
        *dev = (dev_t) makedev(maj, min);