]> git.proxmox.com Git - cargo.git/commitdiff
Fix erronous error with call to write
authorHanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Thu, 27 Feb 2020 22:14:24 +0000 (17:14 -0500)
committerHanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Thu, 27 Feb 2020 22:14:24 +0000 (17:14 -0500)
src/cargo/util/hex.rs

index daa707ddbb744ef18e13ba80486e3f176d59bc82..15258e2d185aebf2c99bee18f11aaf7c7e249dfb 100644 (file)
@@ -31,7 +31,7 @@ pub fn hash_u64_file(mut file: &File) -> u64 {
         if n == 0 {
             break;
         }
-        hasher.write(&buf);
+        hasher.write(&buf[..n]);
     }
     hasher.finish()
 }