summaryrefslogtreecommitdiff
path: root/fileutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fileutils.cpp')
-rw-r--r--fileutils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fileutils.cpp b/fileutils.cpp
index 32ca43e..62e2c0b 100644
--- a/fileutils.cpp
+++ b/fileutils.cpp
@@ -39,7 +39,7 @@ void copy(FILE * s, FILE * d, long size) {
unsigned char c;
long r;
- for (i = 0; i < size; i++) {
+ for (i = 0; (i < size) || (size < 0); i++) {
r = fread(&c, 1, 1, s);
if (r == 0) {
break;