Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!mips!ardent!jra!jss From: jss@jra.ardent.com Newsgroups: comp.lang.c Subject: Re: strncpy Keywords: strncpy null termination Message-ID: <9810@ardent.UUCP> Date: 22 Dec 89 17:36:34 GMT References: <11509@csli.Stanford.EDU> <8313@stiatl.UUCP> <621@buster.irby.com> <11515@csli.Stanford.EDU> Sender: news@ardent.UUCP Reply-To: jss@jra.ardent.com () Organization: Ardent Computer Corp., Sunnyvale, CA Lines: 35 In article <11515@csli.Stanford.EDU> poser@csli.stanford.edu (Bill Poser) writes: > >I at least was not calling for a redefinition of strncpy in my >posting, only asking whether there was a good reason for it to behave >as it does. Not to pick on Bill, because I see questions like this all the time in this newsgroup. But this is not a well posed (groan moan, I couldn't resist :-) question because we don't know what kind of reason will be "good". Do you want Origin: There was a glitch in the XYZ-1 architecture that meant the routine was 10 times faster than the obvious alternative. Historical: When the code was moved from the XYZ-1 to the FOOBAR-990000000 this behavior was unmodified. On the DWIM-9 it was fixed, but when X3J11 decided to standardize there weren't any DWIM-9's around and there were zillions of lines of code derived that dependend on the bug so they standardized on the XYZ-1 behavior. Rationale: It ought to work that way because ... Usually the dominant reason is historical, and frequently there are no good rationales. But is the historical explanation a "good" one? Please, if you ask a question about why some library function behaves the way it does, explain what motivates the question (idle curiosity is fine with me) and what category of answer you're interested in. Jerry Schwarz