Category : C Source Code
Archive   : CSRC2.ZIP
Filename : CPYSTR.C

 
Output of file : CPYSTR.C contained in archive : CSRC2.ZIP
/*
* c p y s t r . c
*/

/*)LIBRARY
*/

#ifdef DOCUMENTATION

title cpystr String Copy
index String copy

synopsis
.s.nf
char *
cpystr(out, in);
char *out;
char *in;
.s.f
Description

Copy "in" to "out". Return a pointer to the end of out.
This allows the following usage:

char *ptr;
char buffer[BUFSIZ];
extern char *cpystr();
...
ptr = cpystr(buffer, text);
ptr = cpystr(ptr, more_text);

The above sequence appends more_text to the copy of text
already moved into the buffer.

Bugs

cpystr is not present on other C libraries.

#endif

#define EOS 0

char *
cpystr(out, in)
register char *out;
register char *in;
/*
* Copy in to out, return &out[strlen(in)]
*/
{
while ((*out++ = *in++) != EOS)
;
return (out - 1);
}


  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : CPYSTR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/