]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tail: remove unnecessary initialization
authorJim Meyering <meyering@redhat.com>
Mon, 31 Aug 2009 15:01:26 +0000 (17:01 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 1 Sep 2009 10:10:07 +0000 (12:10 +0200)
* src/tail.c (tail_bytes): Don't compute "diff" twice.

src/tail.c

index ceda5b6cdf2beb489f104fdcdfda465971305d79..f0dbf5d5ef563434d4fa54df3e11e2a88b046e99 100644 (file)
@@ -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)