summaryrefslogtreecommitdiff
path: root/inotail.c
diff options
context:
space:
mode:
Diffstat (limited to 'inotail.c')
-rw-r--r--inotail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/inotail.c b/inotail.c
index 3c17b38..3f08360 100644
--- a/inotail.c
+++ b/inotail.c
@@ -130,7 +130,7 @@ static off_t lines_to_offset_from_end(struct file_struct *f, unsigned int n_line
return -1;
}
- for (i = block_size; i > 0; i--) {
+ for (i = block_size - 1; i > 0; i--) {
if (buf[i] == '\n') {
if (--n_lines == 0)
return offset += i + 1; /* We don't want the first \n */