Permalink
Browse files

Fix fread result check

  • Loading branch information...
thommey committed May 7, 2018
1 parent 71791fd commit b3cd408a9f839fb9f20262c56f35dcd5757a5fa0
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/mod/transfer.mod/transfer.c
@@ -225,7 +225,7 @@ static unsigned long pump_file_to_sock(FILE *file, long sock,
do {
actual_size = pending_data >= buf_len ? buf_len : pending_data;
r = fread(bf, actual_size, 1, file);
if (r < 0)
if (!r)
break;
tputs(sock, bf, r);
pending_data -= r;

0 comments on commit b3cd408

Please sign in to comment.