xref: /original-bsd/usr.bin/f77/libF77/s_copy.c (revision 93152bbe)
1 /*-
2  * Copyright (c) 1980 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.proprietary.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)s_copy.c	5.2 (Berkeley) 04/12/91";
10 #endif /* not lint */
11 
12 s_copy(a, b, la, lb)	/* assign strings:  a = b */
13 char *a, *b;
14 long int la, lb;
15 {
16 char *aend, *bend;
17 
18 aend = a + la;
19 
20 if(la <= lb)
21 	while(a < aend)
22 		*a++ = *b++;
23 
24 else
25 	{
26 	bend = b + lb;
27 	while(b < bend)
28 		*a++ = *b++;
29 	while(a < aend)
30 		*a++ = ' ';
31 	}
32 }
33