Source-Changes-D archive

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

Re: CVS commit: src/lib/libc



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.

Joerg


Home | Main Index | Thread Index | Old Index