libfstools: fix matching device name
authorDaniel Golle <daniel@makrotopia.org>
Fri, 30 Jun 2017 15:20:22 +0000 (17:20 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 30 Jun 2017 15:25:24 +0000 (17:25 +0200)
commitbdcb075fafdac0bfe3207c23f64acd58432bad86
treebeba215423fc6165ff30f760291fc26a9f0be543
parentef2d4387ee99219f1ead6b4c4c19731d436de44b
libfstools: fix matching device name

compare strlen()+1 characters to make sure we match the trailing \0 as
well. Otherwise things get fishy when using lvm2, see this example:

/dev/mapper/data: UUID="xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx" MOUNT="/mnt" TYPE="LVM2_member"
/dev/mapper/data-fs: UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" LABEL="xxxxxxxx" VERSION="1.0" MOUNT="/mnt" TYPE="ext4"

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
libfstools/find.c