Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!decwrl!hplabs!hp-pcd!orstcs!go From: go@orstcs.UUCP Newsgroups: comp.os.minix Subject: Re: Bug in library routine getenv() Message-ID: <505100014@orstcs> Date: Tue, 5-May-87 12:14:00 EDT Article-I.D.: orstcs.505100014 Posted: Tue May 5 12:14:00 1987 Date-Received: Fri, 8-May-87 05:27:28 EDT References: <3860@cae780.TEK.COM> Lines: 16 Nf-ID: #R:cae780.TEK.COM:-386000:orstcs:505100014:000:712 Nf-From: orstcs.cs.ORST.EDU!go May 5 09:14:00 1987 hubble@cae780.UUCP writes: > I believe there is also a bug in the > library routine strncpy -- it doesn't null terminate the string if the string > to copy is really longer that "n" characters. I have not verified or fixed > this yet, but will post it when I get a chance to cure it. Alas, according to my copy of SystemV Interface Definition, strncpy: "... copies exactly n characters, truncating s2 or adding null characters to s1 if necessary. The reult will *not* [my emphasis added] be null- terminated if the length of s2 is n or more." Since Minix is based upon Version 7, the adherence to this "standard" is expected. Gary Oliver ...!hplabs!hp-pcd!orstcs!go