[OpenAFS-devel] strings redux
Bill Sommerfeld
sommerfeld@orchard.arlington.ma.us
Sat, 11 Aug 2001 08:30:49 -0400
> Actually making bcopy into memcpy isn't safe on all systems since bcopy
> deals with overlapping strings and memcpy doesn't. (At least the FreeBSD
> bcopy manpage says that bcopy does, and memcpy maybe does but it depends
> on your implementation).
It's best to not even think about the possibility that memcpy might
behave properly for overlapping strings.
Those interested in extreme portability would do well to test their
code with a debug-variant run-time library with a memcpy
implementation which assert-fails when presented with overlapping
regions.
- Bill