[ILUG-BOM] Buggy C prog

Satya satyap@[EMAIL-PROTECTED]
Fri Sep 27 11:09:56 IST 2002


On Sep 27, 2002 at 10:18, Philip S Tellis wrote:

>man gets:
>
>       gets() reads a line from stdin into the buffer pointed  to
>                                       ^^^^^^^^^^^^^^^^^^^
>       by  s  until either a terminating newline or EOF, which it
>       replaces with '\0'.  No check for buffer overrun  is  per-
>       formed (see BUGS below).

Bah, I should've used fgets() for my parser, instead of reading a
character at a time and examining it. Bah. Philip, is my method so
horrendous that I should replace it with fgets(), assuming it's not
production code, but for a class project?

-- 
Satya. <URL:http://satya.virtualave.net/>
S met ing's hap ening t  my k ybo rd . .





More information about the Linuxers mailing list