We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents be904a5 + 283b3ce commit dae244aCopy full SHA for dae244a
1 file changed
libcob/fileio.c
@@ -5131,6 +5131,7 @@ CBL_COPY_FILE (unsigned char *fname1, unsigned char *fname2)
5131
{
5132
char *fn1;
5133
char *fn2;
5134
+ char buf[COB_SMALL_BUFF];
5135
int flag = O_BINARY;
5136
int ret;
5137
int i;
@@ -5166,8 +5167,8 @@ CBL_COPY_FILE (unsigned char *fname1, unsigned char *fname2)
5166
5167
}
5168
free (fn2);
5169
ret = 0;
- while ((i = read (fd1, fn1, sizeof(fn1))) > 0) {
5170
- if (write (fd2, fn1, (size_t)i) < 0) {
+ while ((i = read (fd1, buf, sizeof(buf))) > 0) {
5171
+ if (write (fd2, buf, (size_t)i) < 0) {
5172
ret = -1;
5173
break;
5174
0 commit comments