From e995698610ef5f2d812db6b81d0a71b077bc9695 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 3 Nov 2010 12:46:45 +0000 Subject: [PATCH] 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 --- block-vvfat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.39.5