From: Ian Jackson Date: Wed, 3 Nov 2010 12:46:45 +0000 (+0000) Subject: block-vvfat.c: fix warnings with _FORTIFY_SOURCE X-Git-Tag: xen-4.1.0-rc1~18 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e995698610ef5f2d812db6b81d0a71b077bc9695;p=qemu-xen-4.6-testing.git block-vvfat.c: fix warnings with _FORTIFY_SOURCE In function 'snprintf', inlined from 'init_directories' at block-vvfat.c:868:10, inlined from 'vvfat_open' at block-vvfat.c:1065:24: /usr/include/bits/stdio2.h:65:3: warning: call to __builtin___snprintf_chk will always overflow destination buffer Signed-off-by: Kirill A. Shutemov Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori Signed-off-by: Olaf Hering --- diff --git a/block-vvfat.c b/block-vvfat.c index c73add7c3..9eb676bea 100644 --- a/block-vvfat.c +++ b/block-vvfat.c @@ -865,7 +865,8 @@ static int init_directories(BDRVVVFATState* s, { direntry_t* entry=array_get_next(&(s->directory)); entry->attributes=0x28; /* archive | volume label */ - snprintf((char*)entry->name,11,"QEMU VVFAT"); + memcpy(entry->name,"QEMU VVF",8); + memcpy(entry->extension,"AT",3); } /* Now build FAT, and write back information into directory */