home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / c / 3250 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.1 KB  |  26 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!rbutterw
  3. From: rbutterw@math.uwaterloo.ca (Ray Butterworth [MFCF])
  4. Subject: Re: definition of strNcpy
  5. Message-ID: <BzMGp3.Hwr@math.uwaterloo.ca>
  6. Organization: Math Faculty Computing Facility, University of Waterloo
  7. References: <1992Dec18.015228.6094@dms.agames.com> <1992Dec18.180358.24428@dms.agames.com>
  8. Date: Mon, 21 Dec 1992 18:29:26 GMT
  9. Lines: 15
  10.  
  11. In article <1992Dec18.180358.24428@dms.agames.com> lipson@dms.agames.com (Pete Lipson) writes:
  12. >Pete Lipson (lipson@dms.agames.com) wrote:
  13. >: i was just badly bitten by my interpretation of how strncpy works.
  14. >                            ... of course i meant strnCAT ^^^
  15.  
  16. As an aside, does anyone ever actually use strncat?
  17. i.e. what is its intended use?
  18.  
  19. If the "N" were the total length of the data including what is already
  20. in the string, it might be useful.  But as it is, one has to do
  21. something like:
  22.    strncat(out, in, sizeof(out)-strlen(out)-1);
  23. i.e. as long as one has to call strlen on the first argument,
  24. what is the point of having strncat go through the trouble of
  25. finding the end of the string again?
  26.