diff options
author | Bert <ber.t@gmx.com> | 2011-02-15 15:30:37 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-02-15 15:30:37 +0100 |
commit | e8ed491ba9f2fe6df8f071e7c59e0174bb307a1b (patch) | |
tree | e9f9bece1767f44df2bb83e756b45839f50230e4 /util.c | |
parent | cfed65d36fbacf6bec47869c86ea94f1cc49bcb5 (diff) |
Fixed empty lines in readline()
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -102,11 +102,11 @@ char* readline(FILE *stream) { } } while (!end && !feof(stream) && !ferror(stream)); - if (!ferror(stream) && *buf) { + if (ferror(stream)) { + s = NULL; + } else { s = (char*) s_malloc((strlen(buf) + 1) * sizeof(char)); strcpy(s, buf); - } else { - s = NULL; } free(buf); |