home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sdrc!thor!scjones
- From: scjones@thor.sdrc.com (Larry Jones)
- Newsgroups: comp.std.c
- Subject: Re: definition of strNcpy
- Message-ID: <2412@sdrc.COM>
- Date: 18 Dec 92 15:49:46 GMT
- References: <1992Dec18.015228.6094@dms.agames.com>
- Sender: news@sdrc.COM
- Lines: 19
-
- In article <1992Dec18.015228.6094@dms.agames.com>, lipson@dms.agames.com (Pete Lipson) writes:
- > if you say: strncpy(dst,"abcdef",4)
- >
- > does the standard really say you get five characters appended to the
- > dst (the chars 'a' 'b' 'c' 'd' AND the '\0') ???
-
- You talk about strncpy, but then you talk about characters being appended;
- are you really talking about strncpy() or did you mean strncat()?!?
-
- If you really mean strncpy(), then it should replace the first four
- characters of dst with 'a', 'b', 'c', and 'd' with no NUL.
-
- If you mean strncat(), then what you described is exactly right: it
- should append at most 4 characters and then add a NUL.
- ----
- Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070
- larry.jones@sdrc.com or ...uunet!sdrc!larry.jones
- Well of course the zipper's going to get stuck if everyone
- stands around WATCHING me! -- Calvin
-