diff options
author | Daniel Mierswa | 2009-08-17 07:27:39 +0200 |
---|---|---|
committer | Karel Zak | 2009-08-17 11:15:59 +0200 |
commit | c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed (patch) | |
tree | 6d4671545542031f67face36783f8ad64b29057c /fdisk/fdiskbsdlabel.c | |
parent | libblkid: fix cache->probe memory leak (diff) | |
download | kernel-qcow2-util-linux-c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed.tar.gz kernel-qcow2-util-linux-c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed.tar.xz kernel-qcow2-util-linux-c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed.zip |
replace bcopy,bzero,index and rindex
Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008.
Replaced with memmove,memset,strchr and strrchr.
Signed-off-by: Daniel Mierswa <impulze@impulze.org>
Diffstat (limited to 'fdisk/fdiskbsdlabel.c')
-rw-r--r-- | fdisk/fdiskbsdlabel.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fdisk/fdiskbsdlabel.c b/fdisk/fdiskbsdlabel.c index 377b64ec4..d5243b9e9 100644 --- a/fdisk/fdiskbsdlabel.c +++ b/fdisk/fdiskbsdlabel.c @@ -538,7 +538,7 @@ xbsd_write_bootstrap (void) /* We need a backup of the disklabel (xbsd_dlabel might have changed). */ d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE]; - bcopy (d, &dl, sizeof (struct xbsd_disklabel)); + memmove (&dl, d, sizeof (struct xbsd_disklabel)); /* The disklabel will be overwritten by 0's from bootxx anyway */ bzero (d, sizeof (struct xbsd_disklabel)); @@ -555,7 +555,7 @@ xbsd_write_bootstrap (void) exit ( EXIT_FAILURE ); } - bcopy (&dl, d, sizeof (struct xbsd_disklabel)); + memmove (d, &dl, sizeof (struct xbsd_disklabel)); #if defined (__powerpc__) || defined (__hppa__) sector = 0; @@ -740,8 +740,9 @@ xbsd_readlabel (struct partition *p, struct xbsd_disklabel *d) if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE)) fatal (unable_to_read); - bcopy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], - d, sizeof (struct xbsd_disklabel)); + memmove (d, + &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], + sizeof (struct xbsd_disklabel)); if (d -> d_magic != BSD_DISKMAGIC || d -> d_magic2 != BSD_DISKMAGIC) return 0; @@ -776,8 +777,8 @@ xbsd_writelabel (struct partition *p, struct xbsd_disklabel *d) /* This is necessary if we want to write the bootstrap later, otherwise we'd write the old disklabel with the bootstrap. */ - bcopy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], - sizeof (struct xbsd_disklabel)); + memmove (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], d, + sizeof (struct xbsd_disklabel)); #if defined (__alpha__) && BSD_LABELSECTOR == 0 alpha_bootblock_checksum (disklabelbuffer); |