summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@xenon.tklauser.home>2006-05-25 19:42:29 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2006-05-25 19:42:29 +0200
commit0d393b60b398397b91303163b22544135df891d1 (patch)
tree1a1c0d7b962e338523cfb4d66ad9e7daf8355abd
parent122f6162183ea0ea107d1a6007509ecaa32fed0f (diff)
memset() fbuf before using
-rw-r--r--inotail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/inotail.c b/inotail.c
index 0c076be..53cbec1 100644
--- a/inotail.c
+++ b/inotail.c
@@ -211,12 +211,12 @@ static int watch_files(struct file_struct *f, int n_files)
if (verbose)
write_header(fil->name);
+ memset(&fbuf, 0, sizeof(fbuf));
lseek(ffd, offset, SEEK_SET);
while (read(ffd, &fbuf, block_size) != 0) {
write(STDOUT_FILENO, fbuf, block_size);
}
-
close(ffd);
}