svn commit: trunk/busybox: libbb util-linux

vapier at busybox.net vapier at busybox.net
Sun Apr 16 05:58:23 UTC 2006


Author: vapier
Date: 2006-04-15 22:58:21 -0700 (Sat, 15 Apr 2006)
New Revision: 14887

Log:
use memmove() instead of bcopy()

Modified:
   trunk/busybox/libbb/dump.c
   trunk/busybox/util-linux/fdisk.c


Changeset:
Modified: trunk/busybox/libbb/dump.c
===================================================================
--- trunk/busybox/libbb/dump.c	2006-04-16 05:55:15 UTC (rev 14886)
+++ trunk/busybox/libbb/dump.c	2006-04-16 05:58:21 UTC (rev 14887)
@@ -550,12 +550,12 @@
 
 							switch (pr->bcnt) {
 							case 4:
-								bcopy((char *) bp, (char *) &fval,
+								memmove((char *) &fval, (char *) bp,
 									  sizeof(fval));
 								printf(pr->fmt, fval);
 								break;
 							case 8:
-								bcopy((char *) bp, (char *) &dval,
+								memmove((char *) &dval, (char *) bp,
 									  sizeof(dval));
 								printf(pr->fmt, dval);
 								break;
@@ -571,12 +571,12 @@
 								printf(pr->fmt, (int) *bp);
 								break;
 							case 2:
-								bcopy((char *) bp, (char *) &sval,
+								memmove((char *) &sval, (char *) bp,
 									  sizeof(sval));
 								printf(pr->fmt, (int) sval);
 								break;
 							case 4:
-								bcopy((char *) bp, (char *) &ival,
+								memmove((char *) &ival, (char *) bp,
 									  sizeof(ival));
 								printf(pr->fmt, ival);
 								break;
@@ -604,12 +604,12 @@
 								printf(pr->fmt, (unsigned int) * bp);
 								break;
 							case 2:
-								bcopy((char *) bp, (char *) &sval,
+								memmove((char *) &sval, (char *) bp,
 									  sizeof(sval));
 								printf(pr->fmt, (unsigned int) sval);
 								break;
 							case 4:
-								bcopy((char *) bp, (char *) &ival,
+								memmove((char *) &ival, (char *) bp,
 									  sizeof(ival));
 								printf(pr->fmt, ival);
 								break;

Modified: trunk/busybox/util-linux/fdisk.c
===================================================================
--- trunk/busybox/util-linux/fdisk.c	2006-04-16 05:55:15 UTC (rev 14886)
+++ trunk/busybox/util-linux/fdisk.c	2006-04-16 05:58:21 UTC (rev 14887)
@@ -1322,7 +1322,7 @@
 
 /* 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 */
 	memset(d, 0, sizeof(struct xbsd_disklabel));
@@ -1339,7 +1339,7 @@
 			exit(EXIT_FAILURE);
 		}
 
-	bcopy(&dl, d, sizeof(struct xbsd_disklabel));
+	memmove(d, &dl, sizeof(struct xbsd_disklabel));
 
 #if defined (__powerpc__) || defined (__hppa__)
 	sector = 0;
@@ -1526,8 +1526,8 @@
 	if (BSD_BBSIZE != read(fd, disklabelbuffer, BSD_BBSIZE))
 		fdisk_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;
@@ -1562,8 +1562,8 @@
 	/* 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);




More information about the busybox-cvs mailing list