diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-01 11:08:30 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-01 11:15:38 -0700 |
commit | 1a9db808992906eb599d9cdabec2e45de181fc1d (patch) | |
tree | 371a0a78c676cbe7b69a1b70bac70b3130d6be5b /src | |
parent | 8d26b1403e8607811ccebdfe2822f2dad42a36d3 (diff) | |
download | diffutils-1a9db808992906eb599d9cdabec2e45de181fc1d.tar.gz |
cmp: fix -l width bug
Problem reported by Dave Odell (Bug#37558).
* src/cmp.c (cmp): Treat negative ‘bytes’ as infinite, fixing a
bug introduced in the 2019-08-27 patch that fixed Bug#35256.
Diffstat (limited to 'src')
-rw-r--r-- | src/cmp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -394,7 +394,8 @@ cmp (void) if (comparison_type == type_all_diffs) { - off_t byte_number_max = MIN (bytes, TYPE_MAXIMUM (off_t)); + off_t byte_number_max = (0 <= bytes && bytes <= TYPE_MAXIMUM (off_t) + ? bytes : TYPE_MAXIMUM (off_t)); for (f = 0; f < 2; f++) if (S_ISREG (stat_buf[f].st_mode)) |