diff options
-rw-r--r-- | read.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -42,7 +42,6 @@ static char* getline(size_t* n, FILE* file) { if (c == '\n') break; } out[(*n)] = 0; - //(*n)++; return realloc(out, sizeof(char) * (*n+1) ); } @@ -51,7 +50,7 @@ static char* line(FILE* file, bool nl) { // gets a line from file char* link = getline(&n, file); // getline stores a line of len n (size n+1) in link wsclean(link, &n); // removes trailing whitespace - if (n == 1) { // "\n" => "" + if (n == 0) { // "\n" => "" free(link); return empty(); } else { // else return obtained |