summaryrefslogtreecommitdiffstats
path: root/lib/label/label.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2006-05-09 21:23:51 +0000
committerAlasdair Kergon <agk@redhat.com>2006-05-09 21:23:51 +0000
commit72b2cb613a57918dadf9722c59a30ca71d751c8e (patch)
treeae0130e37b873591370abd65ff44cb2a554db049 /lib/label/label.c
parentb810c547004a98a7fc25c8dde65cf88d82ad9652 (diff)
downloadlvm2-72b2cb613a57918dadf9722c59a30ca71d751c8e.tar.gz
lvm2-72b2cb613a57918dadf9722c59a30ca71d751c8e.tar.xz
lvm2-72b2cb613a57918dadf9722c59a30ca71d751c8e.zip
Make SIZE_SHORT the default for display_size().
Fix some memory leaks in error paths found by coverity. Use C99 struct initialisers. Move DEFS into configure.h. Clean-ups to remove miscellaneous compiler warnings.
Diffstat (limited to 'lib/label/label.c')
-rw-r--r--lib/label/label.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/label/label.c b/lib/label/label.c
index 3f7c2f65..3709e1cf 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -128,7 +128,7 @@ static struct labeller *_find_labeller(struct device *dev, char *buf,
lh = (struct label_header *) (readbuf +
(sector << SECTOR_SHIFT));
- if (!strncmp(lh->id, LABEL_ID, sizeof(lh->id))) {
+ if (!strncmp((char *)lh->id, LABEL_ID, sizeof(lh->id))) {
if (found) {
log_error("Ignoring additional label on %s at "
"sector %" PRIu64, dev_name(dev),
@@ -222,7 +222,7 @@ int label_remove(struct device *dev)
wipe = 0;
- if (!strncmp(lh->id, LABEL_ID, sizeof(lh->id))) {
+ if (!strncmp((char *)lh->id, LABEL_ID, sizeof(lh->id))) {
if (xlate64(lh->sector_xl) == sector)
wipe = 1;
} else {
@@ -307,7 +307,7 @@ int label_write(struct device *dev, struct label *label)
memset(buf, 0, LABEL_SIZE);
- strncpy(lh->id, LABEL_ID, sizeof(lh->id));
+ strncpy((char *)lh->id, LABEL_ID, sizeof(lh->id));
lh->sector_xl = xlate64(label->sector);
lh->offset_xl = xlate32(sizeof(*lh));