tailk: fix error detected by testsuite

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-03-12 22:16:25 +01:00
parent f9782ffc45
commit 6eaeb7737d

View File

@ -241,7 +241,8 @@ int tail_main(int argc, char **argv)
} while (nwrite);
}
}
xwrite(STDOUT_FILENO, buf + nread - nwrite, nwrite);
if (nwrite > 0)
xwrite(STDOUT_FILENO, buf + nread - nwrite, nwrite);
} else if (count) {
if (COUNT_BYTES) {
taillen += nread;