aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--read.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/read.c b/read.c
index 5d7602d..f1ecea9 100644
--- a/read.c
+++ b/read.c
@@ -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