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

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!europa.asd.contel.com!gatech!usenet.ins.cwru.edu!agate!spool.mu.edu!sdd.hp.com!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!nntpd.lkg.dec.com!e2big.mko.dec.com!jrdzzz.jrd.dec.com!jit533.jit.dec.com!diamond
  3. From: diamond@jit533.jit.dec.com (Norman Diamond)
  4. Subject: Re: definition of strNcpy
  5. Message-ID: <BzMzqC.n0u@jrd.dec.com>
  6. Sender: usenet@jrd.dec.com (USENET News System)
  7. Nntp-Posting-Host: jit533.jit.dec.com
  8. Reply-To: diamond@jit.dec.com (Norman Diamond)
  9. Organization: Digital Equipment Corporation Japan , Tokyo
  10. References: <1992Dec18.015228.6094@dms.agames.com> <1992Dec18.180358.24428@dms.agames.com> <BzMGp3.Hwr@math.uwaterloo.ca>
  11. Date: Tue, 22 Dec 1992 01:20:35 GMT
  12. Lines: 16
  13.  
  14. In article <BzMGp3.Hwr@math.uwaterloo.ca> rbutterw@math.uwaterloo.ca (Ray Butterworth [MFCF]) writes:
  15. >As an aside, does anyone ever actually use strncat?
  16. >If the "N" were the total length of the data including what is already
  17. >in the string, it might be useful.
  18.  
  19. Remember, a language with gets() and other such niceties is intended for
  20. hacking, not for security.  The "N" is intended to bring over a known portion
  21. of the source string, not to protect other stuff near the target.  Now this
  22. raises the question of why memcpy() was invented, and I don't know the answer.
  23.  
  24. On a more serious note, people actually do use gets().  I'd worry about this
  25. kind of dangerous stuff long before caring about silly things like strncat().
  26. --
  27. Norman Diamond       diamond@jit081.enet.dec.com
  28. If this were the company's opinion, I wouldn't be allowed to post it.
  29. "It's been a lovely recession."
  30.