Commit 08064b07 by Aaron Leung

Forgot the close the file.

parent 3418c4e7
...@@ -6,7 +6,7 @@ char *sass_read_file(char *path) { ...@@ -6,7 +6,7 @@ char *sass_read_file(char *path) {
FILE *f; FILE *f;
f = fopen(path, "rb"); f = fopen(path, "rb");
if (!f) { if (!f) {
printf("Couldn't open file %s", path); printf("ERROR: could not open file %s", path);
abort(); abort();
} }
fseek(f, 0L, SEEK_END); fseek(f, 0L, SEEK_END);
...@@ -15,5 +15,6 @@ char *sass_read_file(char *path) { ...@@ -15,5 +15,6 @@ char *sass_read_file(char *path) {
char *buf = (char *)malloc(len * sizeof(char) + 1); char *buf = (char *)malloc(len * sizeof(char) + 1);
fread(buf, sizeof(char), len, f); fread(buf, sizeof(char), len, f);
buf[len] = '\0'; buf[len] = '\0';
fclose(f);
return buf; return buf;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment