Browse Source

lslocks: fix maj:min scanf

Fixes: https://github.com/util-linux/util-linux/issues/1633
Signed-off-by: Karel Zak <kzak@redhat.com>
pull/1639/head
Karel Zak 5 months ago
parent
commit
9b725af702
  1. 2
      misc-utils/lslocks.c

2
misc-utils/lslocks.c

@ -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);

Loading…
Cancel
Save