From 4386af0298465a1cc8ed42dc07522f625ece3540 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 29 May 2015 11:03:37 +0000 Subject: [PATCH] If reading into buffer, correct the stored file size at EOF, we don't want to look at any garbage that might already be in the buffer after that. From Sebastien Marie. --- usr.bin/file/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/file/file.c b/usr.bin/file/file.c index 961b77148d5..7402fa00c04 100644 --- a/usr.bin/file/file.c +++ b/usr.bin/file/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.40 2015/05/29 07:30:28 nicm Exp $ */ +/* $OpenBSD: file.c,v 1.41 2015/05/29 11:03:37 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -395,7 +395,7 @@ fill_buffer(struct input_file *inf) next = (char *)next + got; left -= got; } - + inf->size -= left; return buffer; } -- 2.20.1