[3298] Fix a warning about strncpy that caused compilation failures via -Werror

This commit is contained in:
claudiol 2018-08-29 18:00:11 -04:00
parent 0a148f61e3
commit 64e9371769

View file

@ -636,7 +636,7 @@ static inline direntry_t* create_short_and_long_name(BDRVVVFATState* s,
entry=array_get_next(&(s->directory)); entry=array_get_next(&(s->directory));
memset(entry->name,' ',11); memset(entry->name,' ',11);
strncpy((char *) entry->name,filename,i); memcpy(entry->name,filename,i);
if(j > 0) if(j > 0)
for (i = 0; i < 3 && filename[j+1+i]; i++) for (i = 0; i < 3 && filename[j+1+i]; i++)