From: balrog Date: Mon, 24 Dec 2007 13:26:04 +0000 (+0000) Subject: Fix number_of_entries for filename of length [13] (Tristan Gingold). X-Git-Tag: TizenStudio_2.0_p2.3~12379 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e080d5dbb8bcd496101c9a31e51d110cb734b83;p=sdk%2Femulator%2Fqemu.git Fix number_of_entries for filename of length [13] (Tristan Gingold). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3842 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/block-vvfat.c b/block-vvfat.c index 708f031..873956d 100644 --- a/block-vvfat.c +++ b/block-vvfat.c @@ -415,14 +415,16 @@ static void init_mbr(BDRVVVFATState* s) static inline int short2long_name(char* dest,const char* src) { int i; + int len; for(i=0;i<129 && src[i];i++) { dest[2*i]=src[i]; dest[2*i+1]=0; } + len=2*i; dest[2*i]=dest[2*i+1]=0; for(i=2*i+2;(i%26);i++) dest[i]=0xff; - return i; + return len; } static inline direntry_t* create_long_filename(BDRVVVFATState* s,const char* filename) @@ -439,7 +441,7 @@ static inline direntry_t* create_long_filename(BDRVVVFATState* s,const char* fil entry->begin=0; entry->name[0]=(number_of_entries-i)|(i==0?0x40:0); } - for(i=0;i