xref: /original-bsd/usr.bin/pascal/libpc/blkcpy.c (revision c3e32dec)
1 /*-
2  * Copyright (c) 1979, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)blkcpy.c	8.1 (Berkeley) 06/06/93";
10 #endif /* not lint */
11 
12 blkcpy(from, to, siz)
13 	register char	*from;
14 	register char	*to;
15 	long		siz;
16 {
17 	register int	size = siz;
18 
19 	if (to < from)
20 		while(size-- > 0)
21 			*to++ = *from++;
22 	else {
23 		to += size;
24 		from += size;
25 		while(size-- > 0)
26 			*--to = *--from;
27 	}
28 }
29