Ok, i've googled this and searched on the forums already and didn't find anything that really helped. This code is segfaulting right after the sleep() call.
Code:#include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { FILE *fp, *ofp; char *mode = 'r'; fprintf(stderr, "Sleeping\n"); printf("Trying to open %s\n",argv[1]); sleep(3); if ((fp = fopen("index.html", mode)) == EOF) { //tried argv[1] where index.html is too fprintf(stderr, "File Not Found\n"); exit(1); } }Index.html exists in the directory the program is being run, I tried using the full path also that didn't help.Code:./getprx index.html Sleeping Segmentation fault



LinkBack URL
About LinkBacks




