1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-03 22:47:46 +00:00

od: fix infinite loop at EOF

Fixes #866
This commit is contained in:
Michael Gehring 2016-04-15 07:40:57 +02:00
parent 2ab055445b
commit 77d1c309cd

View file

@ -71,6 +71,11 @@ fn odfunc(input_offset_base: &Radix, fname: &str) {
let bytes = &mut [b'\x00'; 16];
loop {
match f.read(bytes) {
Ok(0) => {
print_with_radix(input_offset_base, addr);
print!("\n");
break;
}
Ok(n) => {
print_with_radix(input_offset_base, addr);
for b in 0 .. n / mem::size_of::<u16>() {