all repos — tint2 @ 364d0cf7036d7f83cea92c99b983dcbad68c2bc8

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

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
commit

364d0cf7036d7f83cea92c99b983dcbad68c2bc8

parent

f70415d7dbace56d3f69afbe835802a96d837b3e

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M src/util/common.csrc/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);