summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-31 17:01:26 +0200
committerJim Meyering <meyering@redhat.com>2009-09-01 12:10:07 +0200
commit68c9b3183491638492f1029c553160e11cd69f64 (patch)
treefe8d7f9f0689e2b7154bcc76919366605c4e2bef
parent856ba44297c7a05593e61b1cd696be2a296e64ce (diff)
downloadcoreutils-68c9b3183491638492f1029c553160e11cd69f64.tar.xz
maint: tail: remove unnecessary initialization
* src/tail.c (tail_bytes): Don't compute "diff" twice.
-rw-r--r--src/tail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tail.c b/src/tail.c
index ceda5b6cd..f0dbf5d5e 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1437,7 +1437,7 @@ tail_bytes (const char *pretty_filename, int fd, uintmax_t n_bytes,
off_t diff = end_pos - current_pos;
/* Be careful here. The current position may actually be
beyond the end of the file. */
- off_t bytes_remaining = (diff = end_pos - current_pos) < 0 ? 0 : diff;
+ off_t bytes_remaining = diff < 0 ? 0 : diff;
off_t nb = n_bytes;
if (bytes_remaining <= nb)