[net.lang.c] Copy strings with \"strcpy\", not an idiom

BLARSON%ECLD@ECLA (Bob Larson) (03/21/85)

I don't seem to have problems with strncpy not leaving a terminating '\0'.
Maybe this is because I always make sure the n is at least one less than
the length of the destination, and that the last character of the array
is initialized to '\0'.  I thought that this technique was obvious.

Bob Larson <BLarson@Usc-Ecl.Arpa>
  ... ucbvax!blarson@usc-ecl

"Using an outdated vocabulary can cause unpredictable results."
                                  -- Prime Information
-------

sasaki@harvard.ARPA (Marty Sasaki) (03/22/85)

Maybe I've been missing something. Most of time when you use strcpy you
don't want the result so you should always use strcpy. If an idiom will
run faster then define a macro. Then when you change systems, you can
choose how to implement string copy.
-- 
----------------
  Marty Sasaki				net:   sasaki@harvard.{arpa,uucp}
  Havard University Science Center	phone: 617-495-1270
  One Oxford Street
  Cambridge, MA 02138