Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!jarthur!aqdata!sullivan From: sullivan@aqdata.uucp (Michael T. Sullivan) Newsgroups: comp.lang.c Subject: Re: strncpy Message-ID: <1989Dec21.183242.13146@aqdata.uucp> Date: 21 Dec 89 18:32:42 GMT References: <11509@csli.Stanford.EDU> Organization: aQdata, Inc. Western Region -- San Dimas, CA Lines: 15 From article <11509@csli.Stanford.EDU>, by poser@csli.Stanford.EDU (Bill Poser): > > Why is it that strncpy(3) does not null terminate > the string if the length of the source string is greater than > or equal to the length of the target buffer? I cannot think of It's so you can do things like: strncpy(s1, s2, len)[len] = '\0'; and really freak people out! :-) -- Michael Sullivan uunet!jarthur.uucp!aqdata!sullivan aQdata, Inc. San Dimas, CA