aboutsummaryrefslogtreecommitdiff
path: root/lib/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/file.c')
-rw-r--r--lib/file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/file.c b/lib/file.c
index dbfe81cfa..8926105e9 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -230,11 +230,11 @@ static CURLcode file_upload(struct connectdata *conn)
if(res)
break;
- nread = (size_t)readcount;
-
- if (nread <= 0)
+ if (readcount <= 0)
break;
+ nread = (size_t)readcount;
+
/* write the data to the target */
nwrite = fwrite(buf, 1, nread, fp);
if(nwrite != nread) {