Commit | Line | Data |
---|---|---|
2e5b25bd | 1 | /* |
a6c6a0df RE |
2 | * Copyright (c) 1980 Regents of the University of California. |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
6 | * @(#)s_copy.c 5.1 %G% | |
2e5b25bd DW |
7 | */ |
8 | ||
9 | s_copy(a, b, la, lb) /* assign strings: a = b */ | |
10 | char *a, *b; | |
11 | long int la, lb; | |
12 | { | |
13 | char *aend, *bend; | |
14 | ||
15 | aend = a + la; | |
16 | ||
17 | if(la <= lb) | |
18 | while(a < aend) | |
19 | *a++ = *b++; | |
20 | ||
21 | else | |
22 | { | |
23 | bend = b + lb; | |
24 | while(b < bend) | |
25 | *a++ = *b++; | |
26 | while(a < aend) | |
27 | *a++ = ' '; | |
28 | } | |
29 | } |