use memmove() instead of bcopy()
This commit is contained in:
parent
4b7b8a58a1
commit
1a54030445
12
libbb/dump.c
12
libbb/dump.c
@ -550,12 +550,12 @@ static void display(void)
|
|||||||
|
|
||||||
switch (pr->bcnt) {
|
switch (pr->bcnt) {
|
||||||
case 4:
|
case 4:
|
||||||
bcopy((char *) bp, (char *) &fval,
|
memmove((char *) &fval, (char *) bp,
|
||||||
sizeof(fval));
|
sizeof(fval));
|
||||||
printf(pr->fmt, fval);
|
printf(pr->fmt, fval);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
bcopy((char *) bp, (char *) &dval,
|
memmove((char *) &dval, (char *) bp,
|
||||||
sizeof(dval));
|
sizeof(dval));
|
||||||
printf(pr->fmt, dval);
|
printf(pr->fmt, dval);
|
||||||
break;
|
break;
|
||||||
@ -571,12 +571,12 @@ static void display(void)
|
|||||||
printf(pr->fmt, (int) *bp);
|
printf(pr->fmt, (int) *bp);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
bcopy((char *) bp, (char *) &sval,
|
memmove((char *) &sval, (char *) bp,
|
||||||
sizeof(sval));
|
sizeof(sval));
|
||||||
printf(pr->fmt, (int) sval);
|
printf(pr->fmt, (int) sval);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
bcopy((char *) bp, (char *) &ival,
|
memmove((char *) &ival, (char *) bp,
|
||||||
sizeof(ival));
|
sizeof(ival));
|
||||||
printf(pr->fmt, ival);
|
printf(pr->fmt, ival);
|
||||||
break;
|
break;
|
||||||
@ -604,12 +604,12 @@ static void display(void)
|
|||||||
printf(pr->fmt, (unsigned int) * bp);
|
printf(pr->fmt, (unsigned int) * bp);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
bcopy((char *) bp, (char *) &sval,
|
memmove((char *) &sval, (char *) bp,
|
||||||
sizeof(sval));
|
sizeof(sval));
|
||||||
printf(pr->fmt, (unsigned int) sval);
|
printf(pr->fmt, (unsigned int) sval);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
bcopy((char *) bp, (char *) &ival,
|
memmove((char *) &ival, (char *) bp,
|
||||||
sizeof(ival));
|
sizeof(ival));
|
||||||
printf(pr->fmt, ival);
|
printf(pr->fmt, ival);
|
||||||
break;
|
break;
|
||||||
|
@ -1322,7 +1322,7 @@ xbsd_write_bootstrap(void)
|
|||||||
|
|
||||||
/* We need a backup of the disklabel (xbsd_dlabel might have changed). */
|
/* We need a backup of the disklabel (xbsd_dlabel might have changed). */
|
||||||
d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE];
|
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 */
|
/* The disklabel will be overwritten by 0's from bootxx anyway */
|
||||||
memset(d, 0, sizeof(struct xbsd_disklabel));
|
memset(d, 0, sizeof(struct xbsd_disklabel));
|
||||||
@ -1339,7 +1339,7 @@ xbsd_write_bootstrap(void)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bcopy(&dl, d, sizeof(struct xbsd_disklabel));
|
memmove(d, &dl, sizeof(struct xbsd_disklabel));
|
||||||
|
|
||||||
#if defined (__powerpc__) || defined (__hppa__)
|
#if defined (__powerpc__) || defined (__hppa__)
|
||||||
sector = 0;
|
sector = 0;
|
||||||
@ -1526,8 +1526,8 @@ xbsd_readlabel (struct partition *p, struct xbsd_disklabel *d)
|
|||||||
if (BSD_BBSIZE != read(fd, disklabelbuffer, BSD_BBSIZE))
|
if (BSD_BBSIZE != read(fd, disklabelbuffer, BSD_BBSIZE))
|
||||||
fdisk_fatal(unable_to_read);
|
fdisk_fatal(unable_to_read);
|
||||||
|
|
||||||
bcopy(&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
|
memmove(d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
|
||||||
d, sizeof(struct xbsd_disklabel));
|
sizeof(struct xbsd_disklabel));
|
||||||
|
|
||||||
if (d->d_magic != BSD_DISKMAGIC || d->d_magic2 != BSD_DISKMAGIC)
|
if (d->d_magic != BSD_DISKMAGIC || d->d_magic2 != BSD_DISKMAGIC)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1562,8 +1562,8 @@ xbsd_writelabel (struct partition *p, struct xbsd_disklabel *d)
|
|||||||
/* This is necessary if we want to write the bootstrap later,
|
/* This is necessary if we want to write the bootstrap later,
|
||||||
otherwise we'd write the old disklabel with the bootstrap.
|
otherwise we'd write the old disklabel with the bootstrap.
|
||||||
*/
|
*/
|
||||||
bcopy(d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
|
memmove(&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
|
||||||
sizeof(struct xbsd_disklabel));
|
d, sizeof(struct xbsd_disklabel));
|
||||||
|
|
||||||
#if defined (__alpha__) && BSD_LABELSECTOR == 0
|
#if defined (__alpha__) && BSD_LABELSECTOR == 0
|
||||||
alpha_bootblock_checksum (disklabelbuffer);
|
alpha_bootblock_checksum (disklabelbuffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user