home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Extra Super CD 1998 January
/
PCPLUS131.iso
/
DJGPP
/
V2
/
DJLSR201.ZIP
/
src
/
libc
/
compat
/
string
/
memccpy.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1995-10-01
|
384 b
|
20 lines
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <string.h>
void *
memccpy(void *t, const void *f, int c, size_t n)
{
c &= 0xff;
if (n)
{
unsigned char *tt = (unsigned char *)t;
const unsigned char *ff = (const unsigned char *)f;
do {
if ((*tt++ = *ff++) == c)
return tt;
} while (--n != 0);
}
return 0;
}