From owner-freebsd-hackers Mon Jan 13 13:55:51 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id NAA08679 for hackers-outgoing; Mon, 13 Jan 1997 13:55:51 -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 NAA08673 for ; Mon, 13 Jan 1997 13:55:46 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id WAA20590 for hackers@freebsd.org; Mon, 13 Jan 1997 22:55:43 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.4/8.6.9) id WAA03076; Mon, 13 Jan 1997 22:27:36 +0100 (MET) Message-ID: Date: Mon, 13 Jan 1997 22:27:35 +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: <3.0.32.19970113112240.00a38800@dimaga.com> 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: <3.0.32.19970113112240.00a38800@dimaga.com>; from Eivind Eklund on Jan 13, 1997 11:22:41 +0100 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As Eivind Eklund wrote: > >malloc errors are bogus, too. :) The hell will break afterwards > >anyway, so it doesn't matter whether it returns `okshells' or > >something else. > > Race condition and possibly (very minor) security problem - I would have it > print "No memory" and exit(EXIT_FAILURE); Hmm. I think calling abort() is better. It gets syslogged. -- 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. ;-)