xref: /csrg-svn/usr.bin/f77/libF77/s_copy.c (revision 47940)
1*47940Sbostic /*-
2*47940Sbostic  * Copyright (c) 1980 The Regents of the University of California.
3*47940Sbostic  * All rights reserved.
422981Skre  *
5*47940Sbostic  * %sccs.include.proprietary.c%
610542Sdlw  */
710542Sdlw 
8*47940Sbostic #ifndef lint
9*47940Sbostic static char sccsid[] = "@(#)s_copy.c	5.2 (Berkeley) 04/12/91";
10*47940Sbostic #endif /* not lint */
11*47940Sbostic 
s_copy(a,b,la,lb)1210542Sdlw s_copy(a, b, la, lb)	/* assign strings:  a = b */
1310542Sdlw char *a, *b;
1410542Sdlw long int la, lb;
1510542Sdlw {
1610542Sdlw char *aend, *bend;
1710542Sdlw 
1810542Sdlw aend = a + la;
1910542Sdlw 
2010542Sdlw if(la <= lb)
2110542Sdlw 	while(a < aend)
2210542Sdlw 		*a++ = *b++;
2310542Sdlw 
2410542Sdlw else
2510542Sdlw 	{
2610542Sdlw 	bend = b + lb;
2710542Sdlw 	while(b < bend)
2810542Sdlw 		*a++ = *b++;
2910542Sdlw 	while(a < aend)
3010542Sdlw 		*a++ = ' ';
3110542Sdlw 	}
3210542Sdlw }
33