Re: printing error messages
- From: "Bill Cunningham" <nospam@xxxxxxxxx>
- Date: Sat, 31 May 2008 14:52:29 GMT
"gsa" <hsggwk@xxxxxxxxx> wrote in message
news:dd7b86c4-554d-439d-ac90-a522770ce6ce@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I just stuck the error function call in the if block and it worked.
if((fp = fopen(stretchesFile, "w")) == NULL) {
error(1, errno, "could not open file %s", stretchesFile);
exit(1);
}
Thanks again for your help!!
For my 2 cents worth exit(1) isn't portable. Try exit(EXIT_FAILURE) from
stdlib.h. For me it has made the difference between a working and non
working program.
Bill
.
- Follow-Ups:
- Re: printing error messages
- From: santosh
- Re: printing error messages
- From: Richard
- Re: printing error messages
- References:
- printing error messages
- From: gsa
- Re: printing error messages
- From: Walter Roberson
- Re: printing error messages
- From: gsa
- Re: printing error messages
- From: gsa
- printing error messages
- Prev by Date: function
- Next by Date: Re: malloc()/realloc() - have I got this right?
- Previous by thread: Re: printing error messages
- Next by thread: Re: printing error messages
- Index(es):
Relevant Pages
|