util: Change misleading variable name "line" to "buffer"

git-svn-id: http://tint2.googlecode.com/svn/trunk@657 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000 2015-01-20 23:43:51 +00:00 committed by mrovi9000@gmail.com
parent f70415d7db
commit 364d0cf703

View file

@ -35,7 +35,7 @@
void copy_file(const char *pathSrc, const char *pathDest)
{
FILE *fileSrc, *fileDest;
char line[100];
char buffer[100];
int nb;
fileSrc = fopen(pathSrc, "rb");
@ -44,9 +44,11 @@ void copy_file(const char *pathSrc, const char *pathDest)
fileDest = fopen(pathDest, "wb");
if (fileDest == NULL) return;
while ((nb = fread(line, 1, 100, fileSrc)) > 0)
if ( nb != fwrite(line, 1, nb, fileDest))
while ((nb = fread(buffer, 1, sizeof(buffer), fileSrc)) > 0) {
if ( nb != fwrite(buffer, 1, nb, fileDest)) {
printf("Error while copying file %s to %s\n", pathSrc, pathDest);
}
}
fclose (fileDest);
fclose (fileSrc);