From 7f2c47b1ff388e06bb9d3dc494b785389349d9d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 9 Sep 2015 00:52:01 +0000 Subject: [PATCH] [FATTEN]: static'ify a variable; do not hardcode array lengths. svn path=/trunk/; revision=69136 --- reactos/tools/fatten/fatten.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/reactos/tools/fatten/fatten.c b/reactos/tools/fatten/fatten.c index a94886058ab..429e2244c33 100644 --- a/reactos/tools/fatten/fatten.c +++ b/reactos/tools/fatten/fatten.c @@ -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); } -- 2.17.1