[resend] memccpy() question
Andreas Schwab
schwab@suse.de
Tue Mar 25 10:05:00 GMT 2003
Jes Sorensen <jes@trained-monkey.org> writes:
|> My question is: Is it reasonable to say that memccpy() has a free go at
|> touching the entire source string as specified by the len argument or is
|> it valid to expect that you can specify a random length as long as the
|> character searched for is within the valid area?
>From the POSIX description:
The memccpy() function shall copy bytes from memory area s2 into s1,
stopping after the first occurrence of byte c (converted to an
unsigned char) is copied, or after n bytes are copied, whichever comes
first.
I'd conclude that memccpy must not touch the memory after the character.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Libc-hacker
mailing list