diff --git a/components/dfs/filesystems/elmfat/ff.c b/components/dfs/filesystems/elmfat/ff.c index e967bc76d7ffcf24dae5d64723d81286af5478fc..014d70f590907ab27cbc57373615d0015827fd74 100644 --- a/components/dfs/filesystems/elmfat/ff.c +++ b/components/dfs/filesystems/elmfat/ff.c @@ -522,13 +522,13 @@ void mem_cpy (void* dst, const void* src, UINT cnt) { BYTE *d = (BYTE*)dst; const BYTE *s = (const BYTE*)src; -#if _WORD_ACCESS == 1 - if (((unsigned)d & 0x03)!=0 || ((unsigned)s & 0x03)!=0) - { - while (cnt--) - *d++ = *s++; - return; - } +#if _WORD_ACCESS == 1 + if (((unsigned)d & 0x03)!=0 || ((unsigned)s & 0x03)!=0) + { + while (cnt--) + *d++ = *s++; + return; + } while (cnt >= sizeof(int)) { *(int*)d = *(int*)s;