From: nicm Date: Fri, 29 May 2015 11:03:37 +0000 (+0000) Subject: If reading into buffer, correct the stored file size at EOF, we don't X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4386af0298465a1cc8ed42dc07522f625ece3540;p=openbsd 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. --- 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; }