From 1ddb6dc9017e599295b768c91c5366ee4727bc28 Mon Sep 17 00:00:00 2001 From: Jokler Date: Tue, 20 Mar 2018 19:51:02 +0100 Subject: Fixed buffer bug in the download function --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils.rs b/src/utils.rs index 06156be..b6c4cf4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -32,7 +32,7 @@ pub fn download(url: &str, max_kib: Option) -> Result Err(e).context(ErrorKind::Read)?, }; - bytes.extend_from_slice(&buf); + bytes.extend_from_slice(&buf[..len]); written += len; // Check if the file is too large to download -- cgit v1.2.3-70-g09d2