On Sun, Mar 04, 2012 at 09:42:21PM +0100, Joerg Sonnenberger wrote:
> On Sun, Mar 04, 2012 at 08:20:20PM +0000, David Laight wrote:
> > I wonder it it would be worth adding a function that is like gets,
> > but takes a buffer length (ie discards the \n - and maybe the rest of the
> > line).
> > 
> > That could be used as a compile-time substitute when the buffer
> > size is known - ie when 'sizeof buffer != sizeof (char *)'
> 
> I don't think that makes too much sense. If you want to read a full
> line, use getline. If you don't, loop with fgets until the full line is
> read.

I was thinging of a header file fix to allow code to compile
without changing the source and with miminal 'security' issues.

        David

-- 
David Laight: da...@l8s.co.uk

Reply via email to