Hi
i get a segmentation fault when i want to close a file i have opened
here is the code
it seg faults on fclose and i cant free tempCode:char *temp; temp = (char *)malloc(1000); ....... if ((fi = fopen(fiPath, "r")) == NULL) { fprintf(stderr, "Error reading file: %s\n", fiPath); fo = NULL; return; } /* copy the whole file into a temp memory location */ while (fgets(line_buffer, 80, fi) != NULL) strcat(temp, line_buffer); fclose(fi); free(temp);