Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: More on strcpy() Message-ID: <3477@haddock.ISC.COM> Date: 14 Apr 88 18:22:17 GMT References: <7712@apple.Apple.Com> <7485@brl-smoke.ARPA> <10731@mimsy.UUCP> <4343@ihlpf.ATT.COM> <10987@mimsy.UUCP> <4383@ihlpf.ATT.COM> <904@mit-caf.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Distribution: na Organization: Interactive Systems, Boston Lines: 9 In article <904@mit-caf.UUCP> vlcek@mit-caf.UUCP (Jim Vlcek) writes: >Why not define strcpy() such that the destination is guaranteed to be >equivalent to the original (before the move) source string? Because, in order for this to work on both strcpy(s,s+1) and strcpy(s+1,s), the implementation has to do extra work to guarantee nondestructiveness. If strcpy is being inline-expanded by the compiler, this can be a significant overhead which is seldom necessary. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint