fgets() is secure as long as (mentioned)the length calculation is correct. However, there is sometimes confusion as to how it deals with input. If there is not a newline in the first 'len' bytes of the file handle, the buffer will not contain a newline, but it will _always_ be NULL terminated.
|