[33] in Kerberos-V5-bugs
Re: bcopy vs. memcpy
daemon@ATHENA.MIT.EDU (Brad Strand)
Thu Oct 18 17:59:10 1990
Date: Thu, 18 Oct 90 16:56:03 CDT
From: bstrand@poplar.cray.com (Brad Strand)
To: sommerfeld@apollo.com
Cc: krb5-testers@ATHENA.MIT.EDU
Maybe I'm in the minority, but I prefer the BSD stuff simply because
they check for and properly handle overlapping input/output
buffer conditions. (Not that I encourage this practice ;-)
>That's what "memmove()" is for; it's _specified_ to do the right thing
>when the input and output strings overlap.
Hmm. I'm not familiar with "memmove"...It's not on any of the
machines I regularly work on.
>(Overlap is not an issue
>for the other mem* functions).
What about memcpy()?
>Bcopy is not specified to behave as
>you state; the man page is silent on the issue, though most
>implementations "do the right thing".
The man pages for "bcopy" on the machines around here
are NOT silent on the overlap issue:
"bcopy() copies length bytes from string b1 to the string b2.
Overlapping strings are handled correctly."
BDS
--
Brad Strand bstrand@cray.com (DOMAIN) uunet!cray!bstrand (UUCP)
Cray Research, Inc. #include <std_disclaimer.h>
"For Angling may be said to be so like Mathematics that it can never be
fully learned; at least not so fully but that there will still be more
new experiments left for the trial of others that succeed us." -- Izaak Walton