Skip to content
  • Stefan Weil's avatar
    block/vvfat: Fix compiler warnings for OpenBSD · f671d173
    Stefan Weil authored
    
    
    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: default avatarStefan Weil <sw@weilnetz.de>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    f671d173