diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-11-11 11:32:05 -0800 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-11-11 11:32:05 -0800 |
commit | c9b09f54d783689261855bd87a2bc68bfb3d9731 (patch) | |
tree | 3ee19694b048c3beea7ed27bf3a87d3e70409844 | |
parent | 28eaec94f936534573907425cf0fb5198979aab3 (diff) |
Use memmove rather than bcopy
bcopy was removed in POSIX 2008. I didn't check to see if we could
safely use memcpy.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | x2pmp.c | 3 | ||||
-rw-r--r-- | xpr.c | 7 |
2 files changed, 6 insertions, 4 deletions
@@ -11,6 +11,7 @@ #include <X11/XWDFile.h> #include <X11/Xfuncs.h> #include <errno.h> +#include <string.h> #include "pmp.h" #include "xpr.h" @@ -198,7 +199,7 @@ void x2pmp(FILE *in, FILE *out, unsigned char *dst = ss+j*scale; unsigned char *expansion = tbl+scale*src[j]; for(k = 0; k < scale; k++, dst += byte_width*scale) { - bcopy((char *) expansion, (char *) dst, scale); + memmove((char *) dst, (char *) expansion, scale); } } } @@ -77,6 +77,7 @@ from the X Consortium. #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> +#include <string.h> #ifndef WIN32 #include <pwd.h> #endif @@ -1183,7 +1184,7 @@ void ln03_setup( xm = (((scale * iw) - (i * 30)) / 2) + lm; sprintf(bp, LN_HPA, xm); bp += strlen(bp); sprintf(bp, LN_SGR, 3); bp += strlen(bp); - bcopy(header, bp, i); + memmove(bp, header, i); bp += i; } if (trailer != NULL) { @@ -1192,7 +1193,7 @@ void ln03_setup( xm = (((scale * iw) - (i * 30)) / 2) + lm; sprintf(bp, LN_HPA, xm); bp += strlen(bp); sprintf(bp, LN_SGR, 3); bp += strlen(bp); - bcopy(trailer, bp, i); + memmove(bp, trailer, i); bp += i; } @@ -1740,7 +1741,7 @@ void ps_output_bits( ibuf = (unsigned char *)malloc((unsigned)(iwb + 3)); for (i=0;i<ih;i++) { - bcopy((char *)buffer, (char *)ibuf, iwb); + memmove((char *)ibuf, (char *)buffer, iwb); buffer += iwb; if (!(*(char *) &swaptest)) _swaplong((char *)ibuf,(long)iwb); |