Rewinded 'fp' before closing it

master
Aadhavan Srinivasan 2 years ago
parent 65f731651b
commit 768d3fcedf

@ -15,6 +15,7 @@ char* file_to_string(char* filename) {
fread(buffer,1,file_size,fp);
rewind(fp);
fclose(fp);
return buffer;
@ -44,6 +45,7 @@ int num_of_lines(char* filename) {
}
}
rewind(fp);
fclose(fp);
return num_lines;

Loading…
Cancel
Save