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

RE: [LCP]Very Small Doubt...



On Mon, 8 Jul 2002, Vincent Penquerc'h wrote:

> However, remember than with scanf, you can't (AFAIK) size the allocated
> memory to what is read, thus, stack smashing possibility in the first
> patch, and arena corruption in the second. A safer way is to read
> little bits by little bits (of known size) and allocate accordingly.

Or use readline(3), getline(3) or the C++ string type; all are far more
convenient that doing this manually.

-Jack