From 364d0cf7036d7f83cea92c99b983dcbad68c2bc8 Mon Sep 17 00:00:00 2001 From: o9000 Date: Tue, 20 Jan 2015 23:43:51 +0000 Subject: [PATCH] util: Change misleading variable name "line" to "buffer" git-svn-id: http://tint2.googlecode.com/svn/trunk@657 121b4492-b84c-0410-8b4c-0d4edfb3f3cc --- src/util/common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/util/common.c b/src/util/common.c index f6fa36e..d73edbb 100644 --- a/src/util/common.c +++ b/src/util/common.c @@ -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);