E
Emmanuel Delahaye
H.A. Sujith vient de nous annoncer :
Do you mean here ?
Sounds good to me. Might be something else (try to rebuild all) or a
compiler's bug. Try with another one.
The following code is causing a segfault at the first if statement.
Am I doing something wrong or is it a compiler bug?
//----------
#include <stdio.h>
int main(int argc, char *argv[])
{
int c;
FILE *inp;
if(argc > 2) {
Do you mean here ?
printf("Too many arguments\n");
return 1;
} else if(argc > 1)
if((inp = fopen(argv[1], "r")) == NULL) {
printf("error: unable to open file %s\n", argv[1]);
return 2;
}
else
inp = stdin;
//..
Sounds good to me. Might be something else (try to rebuild all) or a
compiler's bug. Try with another one.