1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00

Creating pattern string works correctly now

This commit is contained in:
Fort 2015-12-30 13:30:20 -08:00
parent 4a42b981f9
commit 67698a9f2e

View file

@ -314,10 +314,9 @@ fn get_size(size_str_opt: Option<String>) -> Option<u64> {
fn bytes_to_string(bytes: &[u8]) -> String { fn bytes_to_string(bytes: &[u8]) -> String {
let mut s: String = String::new(); let mut s: String = String::new();
while s.len() < 6 { while s.len() < 6 {
if bytes.len() == 1 && bytes[0] == (0 as u8) { for b in bytes {
s.push('0'); let readable: String = format!("{:x}", b);
} else { s.push_str(&readable);
s.push('?');
} }
} }