diff options
author | Karel Zak | 2008-10-16 14:46:50 +0200 |
---|---|---|
committer | Karel Zak | 2009-02-11 23:21:46 +0100 |
commit | 828f432e1279cf9de0d01d728564947d533a9a07 (patch) | |
tree | 0e9fca8cdd3cd8b23c01569eaefe20542f3cfa9c /libs/blkid/src/probe.c | |
parent | blkid: add iso9600 (diff) | |
download | kernel-qcow2-util-linux-828f432e1279cf9de0d01d728564947d533a9a07.tar.gz kernel-qcow2-util-linux-828f432e1279cf9de0d01d728564947d533a9a07.tar.xz kernel-qcow2-util-linux-828f432e1279cf9de0d01d728564947d533a9a07.zip |
blkid: add LVM2 support and a fix _sprintf_uuid() bug
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libs/blkid/src/probe.c')
-rw-r--r-- | libs/blkid/src/probe.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index a379d5c5a..5b7fe6fa7 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -67,7 +67,8 @@ static const struct blkid_idinfo *idinfos[] = &hfsplus_idinfo, &hfs_idinfo, &ntfs_idinfo, - &iso9660_idinfo + &iso9660_idinfo, + &lvm2_idinfo }; #ifndef ARRAY_SIZE @@ -630,9 +631,9 @@ int blkid_probe_sprintf_uuid(blkid_probe pr, unsigned char *uuid, if (str && *str) v = blkid_probe_assign_value(pr, "UUID"); if (v) { - memcpy(v->data, str, len); - v->data[len] = '\0'; - v->len = len; + strncpy((char *) v->data, str, BLKID_PROBVAL_BUFSIZ); + v->data[BLKID_PROBVAL_BUFSIZ - 1] = '\0'; + v->len = strlen((char *) v->data); rc = 0; } } else |