From owner-freebsd-hackers Sat Jan 11 04:25:18 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id EAA15856 for hackers-outgoing; Sat, 11 Jan 1997 04:25:18 -0800 (PST) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id EAA15850 for ; Sat, 11 Jan 1997 04:25:13 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id NAA21940 for hackers@FreeBSD.org; Sat, 11 Jan 1997 13:25:09 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.4/8.6.9) id NAA29765; Sat, 11 Jan 1997 13:20:23 +0100 (MET) Message-ID: Date: Sat, 11 Jan 1997 13:20:23 +0100 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@FreeBSD.org Subject: Re: number of lines in a file, given its size References: <199701110202.DAA29018@xp11.frmug.org> X-Mailer: Mutt 0.55-PL10 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199701110202.DAA29018@xp11.frmug.org>; from Philippe Charnier on Jan 11, 1997 03:02:10 +0100 Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk As Philippe Charnier wrote: > In line 115 in /usr/src/lib/libc/gen/getusershell.c: > > shells = calloc((unsigned)statb.st_size / 3, sizeof (char *)); > ^^^^^^^^^^^^^^^^^ > Isn't this a suspicious approximation of the number of lines in /etc/shells > (just put `/' in it for example of an invalid entry). You are certainly right, but i think that's a moot point basically. It requires you at least the following file in order to break: /bin/sh /bin/csh / / / / (Note, no comments allowed.) Of course, this file is entirely bogus anyway, and even adding a single character after the slash keeps it in balance with that assumption. Anyway, we appreciate your PR containing the correct fix. :-) -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)