fix length after '\' getline string termination

This commit is contained in:
Hiltjo Posthuma
2016-02-25 21:42:36 +01:00
committed by sin
parent 58257275f0
commit e8eeb19fcd
5 changed files with 8 additions and 8 deletions

2
tail.c
View File

@@ -23,7 +23,7 @@ dropinit(FILE *fp, const char *str, size_t n)
if (mode == 'n') {
while (i < n && (len = getline(&buf, &size, fp)) > 0)
if (len > 0 && buf[len - 1] == '\n')
if (buf[len - 1] == '\n')
i++;
} else {
while (i < n && (len = efgetrune(&r, fp, str)))