util: Change misleading variable name "line" to "buffer" git-svn-id: http://tint2.googlecode.com/svn/trunk@657 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
o9000 o9000
1 files changed,
5 insertions(+),
3 deletions(-)
jump to
M
src/util/common.c
→
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 @@
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);