]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
block/vvfat: Fix compiler warnings for OpenBSD
authorStefan Weil <sw@weilnetz.de>
Wed, 11 Dec 2013 20:37:11 +0000 (21:37 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 13 Dec 2013 13:49:50 +0000 (14:49 +0100)
commitf671d173c7e1da555b693e8b14f3ed0852601809
treee3add2447d4ad3ba901cff9eb16ba4d9c7e28df3
parent01443e1388971999514511a26f9d36a7cdaa2cc2
block/vvfat: Fix compiler warnings for OpenBSD

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 <sw@weilnetz.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vvfat.c