From owner-freebsd-hackers Sun Jan 12 12:51:47 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id MAA20576 for hackers-outgoing; Sun, 12 Jan 1997 12:51:47 -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 MAA20571 for ; Sun, 12 Jan 1997 12:51:40 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id VAA25027 for hackers@freebsd.org; Sun, 12 Jan 1997 21:51:34 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.4/8.6.9) id VAA13806; Sun, 12 Jan 1997 21:49:37 +0100 (MET) Message-ID: Date: Sun, 12 Jan 1997 21:49:37 +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: <199701121952.MAA26127@phaeton.artisoft.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: <199701121952.MAA26127@phaeton.artisoft.com>; from Terry Lambert on Jan 12, 1997 12:52:08 -0700 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As Terry Lambert wrote: > > But you've got your point wrong. strdup(), as much you prefer it or > > not, was _by no means_ the answer to the question. The question was > You were the one concerned with the fixed buffer size (apparently as > a means of an unlikely stack overflow attack). Yes. But Terry, you totally missed the point here, i'm telling you for the third time now. I stop telling you this. Go, and read the code! You can't allocate an array of pointers with strdup(). Period. > You were also the one concerned about "readability" for a well defined > return value from strcpy(), which everyone reading the code *should* > now is the copy target address. This was in su(1), not in getusershell(3). -- 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. ;-)