[FATTEN]: static'ify a variable; do not hardcode array lengths.

svn path=/trunk/; revision=69136
This commit is contained in:
Hermès Bélusca-Maïto 2015-09-09 00:52:01 +00:00
parent d2e60268e5
commit 7f2c47b1ff

View file

@ -11,8 +11,7 @@
#include "fatfs/ff.h"
#include "fatfs/diskio.h"
FATFS g_Filesystem;
static FATFS g_Filesystem;
static int isMounted = 0;
static char buff[32768];
@ -277,7 +276,7 @@ int main(int oargc, char* oargv[])
goto exit;
}
while ((rdlen = fread(buff, 1, 32768, fe)) > 0)
while ((rdlen = fread(buff, 1, sizeof(buff), fe)) > 0)
{
f_write(&fv, buff, rdlen, &wrlen);
}
@ -316,7 +315,7 @@ int main(int oargc, char* oargv[])
goto exit;
}
while ((f_read(&fe, buff, 32768, &rdlen) == 0) && (rdlen > 0))
while ((f_read(&fe, buff, sizeof(buff), &rdlen) == 0) && (rdlen > 0))
{
fwrite(buff, 1, rdlen, fv);
}
@ -362,7 +361,7 @@ int main(int oargc, char* oargv[])
goto exit;
}
while ((f_read(&fe, buff, 32768, &rdlen) == 0) && (rdlen > 0))
while ((f_read(&fe, buff, sizeof(buff), &rdlen) == 0) && (rdlen > 0))
{
f_write(&fv, buff, rdlen, &wrlen);
}