Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: strcpy: "after the null has been copied" Message-ID: <1033@mcgill-vision.UUCP> Date: 8 Apr 88 08:40:15 GMT References: <7712@apple.Apple.Com> <7485@brl-smoke.ARPA> <10731@mimsy.UUCP> <793@cresswell.quintus.UUCP> Organization: McGill University, Montreal Lines: 21 In article <793@cresswell.quintus.UUCP>, ok@quintus.UUCP (Richard A. O'Keefe) writes: > The UNIX manuals say of strcpy(s1, s2) that it > "copies s2 to s1, stopping after the null character has been copied." > While they doesn't strictly speaking say anything about the order in > which the other characters are copied, they _do_ say that the NUL > character must be copied last, Ah, but they don't. A strict interpretation would take your quote as meaning nothing more than that strcpy is guaranteed to copy the null, because it is specified that it won't stop before that, and does say that it stops (after that). Nothing is said (by the above quote) about whether it copies anything after the null, or whether it does the null (temporally) first, last, or somewhere in between. There is a strong implication that either (a) it doesn't copy the character after the null or (b) that it copies the null last, depending on whether you take "after" to mean in the array or in time, but it's only an implication, and an ambiguous one at that. der Mouse uucp: mouse@mcgill-vision.uucp arpa: mouse@larry.mcrcim.mcgill.edu