Article View: comp.std.c
Article #2898Re: definition of strNcpy
From: Ray Butterworth [MFCF]
Date: Mon, 21 Dec 1992 18:29
Date: Mon, 21 Dec 1992 18:29
15 lines
1186 bytes
1186 bytes
In article <1992Dec18.180358.24428@dms.agames.com> lipson@dms.agames.com (Pete Lipson) writes: >Pete Lipson (lipson@dms.agames.com) wrote: >: i was just badly bitten by my interpretation of how strncpy works. > ... of course i meant strnCAT ^^^ As an aside, does anyone ever actually use strncat? i.e. what is its intended use? If the "N" were the total length of the data including what is already in the string, it might be useful. But as it is, one has to do something like: strncat(out, in, sizeof(out)-strlen(out)-1); i.e. as long as one has to call strlen on the first argument, what is the point of having strncat go through the trouble of finding the end of the string again?
Technical Details
Message-ID:
<BzMGp3.Hwr@math.uwaterloo.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!rbutterwReferences:
<1992Dec18.015228.6094@dms.agames.com> <1992Dec18.180358.24428@dms.agames.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!rbutterw From: rbutterw@math.uwaterloo.ca (Ray Butterworth [MFCF]) Subject: Re: definition of strNcpy Message-ID: <BzMGp3.Hwr@math.uwaterloo.ca> Organization: Math Faculty Computing Facility, University of Waterloo References: <1992Dec18.015228.6094@dms.agames.com> <1992Dec18.180358.24428@dms.agames.com> Date: Mon, 21 Dec 1992 18:29:26 GMT Lines: 15