On 01 November 2007 15:15, Lewis Hyatt wrote:
>>> if (fp==NULL)
>>> {
>>> printf("error, NULL pointer!\n");
>>> return(1);
>>> }
> I think what the OP is saying is that if he adds the check for null,
> then his code works normally, including the file read operation, (ie,
> the pointer is not null), but if he removes the check, then he gets a
> segfault.
Please observe that the "check for NULL" also includes a return statement
that bypasses the rest of the code .... including in particular the file read
operation.
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
Unsubscribe info:
http://cygwin.com/ml/#unsubscribe-simpleProblem reports:
http://cygwin.com/problems.htmlDocumentation:
http://cygwin.com/docs.htmlFAQ:
http://cygwin.com/faq/