Skip to content

Commit

Permalink
Only read number of bytes read.
Browse files Browse the repository at this point in the history
  • Loading branch information
trevarj committed Jul 14, 2020
1 parent 92ea0d9 commit e4b5428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libtiny_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ fn dcc_file_get(
Ok(bytes) => {
bytes_received += bytes as u32;
// Write bytes to file
if let Err(err) = file.write(&buf).await {
if let Err(err) = file.write(&buf[..bytes]).await {
error!("{}", err);
let err_msg = "Error writing to file.";
dcc_to_msgchan(&mut msg_chan, target.as_str(), err_msg).await;
Expand Down

0 comments on commit e4b5428

Please sign in to comment.