[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#70762: textutils: tail segfault



On Sat, Nov 16, 2002 at 08:18:40PM -0500, H. S. Teoh wrote:
> 
> Why does it have to use fprintf? It's hard to imagine fprintf() not

Read the coreutils source code.

> requiring to malloc any buffers, since it *is* supposed to handle output
> to files, and it has to parse & expand format strings, etc.. Perhaps the
> real issue is that fatal error messages should not be output through
> fprintf, but a special, last-resort output facility that doesn't require
> extra memory.

I can think of quite a few ways to do fprintf("%s: ", s) without using
malloc.  In the fact, you can find a mallocless implementation in the
Linux kernel.
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Reply to: