diff options
-rw-r--r-- | src/od.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1397,12 +1397,16 @@ dump () { end_offset = n_bytes_to_skip + max_bytes_to_format; - n_bytes_read = 0; - while (current_offset < end_offset) + while (1) { size_t n_needed; n_needed = MIN (end_offset - current_offset, (off_t) bytes_per_block); + if (n_needed == 0) + { + n_bytes_read = 0; + break; + } err |= read_block (n_needed, block[idx], &n_bytes_read); if (n_bytes_read < bytes_per_block) break; |