diff options
Diffstat (limited to 'lib/libF77/s_copy.c')
-rw-r--r-- | lib/libF77/s_copy.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/libF77/s_copy.c b/lib/libF77/s_copy.c new file mode 100644 index 0000000..989f5dd --- /dev/null +++ b/lib/libF77/s_copy.c @@ -0,0 +1,27 @@ +#include "f2c.h" + +/* assign strings: a = b */ + +#ifdef KR_headers +VOID s_copy(a, b, la, lb) register char *a, *b; ftnlen la, lb; +#else +void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb) +#endif +{ +register char *aend, *bend; + +aend = a + la; + +if(la <= lb) + while(a < aend) + *a++ = *b++; + +else + { + bend = b + lb; + while(b < bend) + *a++ = *b++; + while(a < aend) + *a++ = ' '; + } +} |