Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/uu/od/src/od.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,15 +616,13 @@ fn extract_strings_from_input(

loop {
// Check if we've reached the read_bytes limit
if let Some(limit) = read_bytes {
if bytes_read >= limit {
// Special case: when -N limit is reached with a pending string
// that meets min_length, output it even without null terminator
if current_string.len() >= min_length {
print_string(string_start_offset, &current_string)?;
}
break;
if read_bytes.is_some_and(|l| bytes_read >= l) {
// Special case: when -N limit is reached with a pending string
// that meets min_length, output it even without null terminator
if current_string.len() >= min_length {
print_string(string_start_offset, &current_string)?;
}
break;
}

// Read one byte at a time
Expand Down
Loading