home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / std / c / 3236 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.3 KB  |  38 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!umn.edu!csus.edu!netcom.com!netcomsv!dms!lipson
  3. From: lipson@dms.agames.com (Pete Lipson)
  4. Subject: Re: definition of strNcpy
  5. Message-ID: <1992Dec18.180358.24428@dms.agames.com>
  6. Organization: Atari Games Corporation
  7. X-Newsreader: TIN [version 1.1 PL6]
  8. References: <1992Dec18.015228.6094@dms.agames.com>
  9. Date: Fri, 18 Dec 1992 18:03:58 GMT
  10. Lines: 26
  11.  
  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. :   The MAN page for it IMPLIES that it works this way; is the standard this
  17. : ambiguous too?
  18. :   if you say:   strnCAT(dst,"abcdef",4)
  19. :  does the standard really say you get five characters appended to the
  20. : dst (the chars 'a' 'b' 'c' 'd' AND the '\0') ???
  21. :   the man-page says it moves AT MOST the count (4 in this case) characters
  22. : but it ALSO says it returns a pointer to a NULL-TERMINATED result.
  23. :   I would have assumed in that case that you would have to move at most
  24. : 3 non-null characters!
  25. : -- 
  26. :   /V\
  27. : -/@-*\- Peter Lipson <-- lipson@agames.com   or   netcom!dms!lipson
  28. :  \_o_/  Milpitas, CA <-- Atari Games
  29. :    U
  30. -- 
  31.   /V\
  32. -/@-*\- Peter Lipson <-- lipson@agames.com   or   netcom!dms!lipson
  33.  \_o_/  Milpitas, CA <-- Atari Games
  34.    U
  35.