Date: Sun, 12 Jan 1997 19:57:25 +0100 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@freebsd.org Subject: Re: number of lines in a file, given its size Message-ID: <Mutt.19970112195725.j@uriah.heep.sax.de> In-Reply-To: <199701121833.LAA25809@phaeton.artisoft.com>; from Terry Lambert on Jan 12, 1997 11:33:06 -0700 References: <Mutt.19970111234854.j@uriah.heep.sax.de> <199701121833.LAA25809@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
As Terry Lambert wrote: > > > strdup() to the rescue! ... > > > > Failed. Try again. UTSL first. > > J"org, you are downright diabolical... > > Obviously, I wasn't citing code in this case, only a method of functional > decomposition. 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 how much space to allocate for the pointers you get from strdup() or whatever has been chosen. You can solve this problem with realloc(), but it seems that the existing solution is, though dirty, much less overkill. -- 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. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Mutt.19970112195725.j>