From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr2Yp-0007F5-W3 for qemu-devel@nongnu.org; Thu, 12 Dec 2013 04:28:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr2Yj-0004nS-OG for qemu-devel@nongnu.org; Thu, 12 Dec 2013 04:27:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr2Yj-0004mg-Fp for qemu-devel@nongnu.org; Thu, 12 Dec 2013 04:27:53 -0500 Date: Thu, 12 Dec 2013 10:20:06 +0100 From: Kevin Wolf Message-ID: <20131212092006.GC10007@dhcp-200-207.str.redhat.com> References: <1386794231-18119-1-git-send-email-sw@weilnetz.de> <20131212082257.GE13302@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131212082257.GE13302@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH] block/vvfat: Fix compiler warnings for OpenBSD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Stefan Weil , qemu-devel Am 12.12.2013 um 09:22 hat Stefan Hajnoczi geschrieben: > On Wed, Dec 11, 2013 at 09:37:11PM +0100, Stefan Weil wrote: > > The buildbot shows these compiler warnings: > > > > block/vvfat.c: In function 'create_short_and_long_name': > > block/vvfat.c:620: warning: array size (8) smaller than bound length (11) > > block/vvfat.c:620: warning: array size (8) smaller than bound length (11) > > block/vvfat.c:635: warning: array size (8) smaller than bound length (11) > > block/vvfat.c:635: warning: array size (8) smaller than bound length (11) > > > > They are caused by tricky code where 8 characters for the name are followed > > by 3 characters for the extension, and some operations touch both name and > > extension. > > > > Using an 11 character name which includes the extension fixes the compiler > > warning, satisfies cppcheck, valgrind and maybe other static and dynamic > > code checkers, and even simplifies some parts of the code. > > > > Signed-off-by: Stefan Weil > > --- > > block/vvfat.c | 43 ++++++++++++++++++++++--------------------- > > 1 file changed, 22 insertions(+), 21 deletions(-) > > Reviewed-by: Stefan Hajnoczi Thanks, applied to the block branch. Kevin