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>
{
FILE *fp = fopen("/proc/mounts", "r");
static char line[256];
- char *point = NULL;
if(!fp)
return NULL;
fclose(fp);
- return point;
+ return NULL;
}
/*
devname = tmp;
/* if device name matches */
- if (!strncmp(block, devname, len)) {
+ if (!strncmp(block, devname, len + 1)) {
if (root_only && fs_rootfs_only(fstype))
break;