summaryrefslogtreecommitdiff
path: root/src/tac.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-05-29 15:33:59 +0100
committerPádraig Brady <P@draigBrady.com>2015-05-30 00:41:09 +0100
commitb9842a615366b47cbd0739d97f2dd2679dfbb3a8 (patch)
treec272db54a8a0539db3f6eb6416cf6c422bf8e1f2 /src/tac.c
parent17621b594a74af2cf77a7120b89add47397dbd11 (diff)
downloadcoreutils-b9842a615366b47cbd0739d97f2dd2679dfbb3a8.tar.xz
maint: avoid new coverity warnings
* src/sync.c (sync_arg): Initialise variable to avoid unitialized access if assert is disabled. * src/head.c (elide_tail_bytes_file): Support this function with ---presume-input-pipe and larger files, which regressed with commit v8.23-47-g2662702. (elide_tail_lines_file): Likewise. * src/dd.c (dd_copy): Explicitly don't try to ftruncate() upon failure to lseek() (the existing check against st_size was already protecting that). * src/factor.c (factor_using_squfof): Assert (only when linting due to performance) to avoid the implication of divide by zero. * src/od.c (read_block): Remove dead code. * src/tac.c (tac_seekable): Likewise. * src/ls.c (gobble_file): Likewise.
Diffstat (limited to 'src/tac.c')
-rw-r--r--src/tac.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/tac.c b/src/tac.c
index 2d73c6e78..57e7e761d 100644
--- a/src/tac.c
+++ b/src/tac.c
@@ -321,8 +321,6 @@ tac_seekable (int input_fd, const char *file, off_t file_pos)
'G_buffer_size'. */
char *newbuffer;
size_t offset = sentinel_length ? sentinel_length : 1;
- ptrdiff_t match_start_offset = match_start - G_buffer;
- ptrdiff_t past_end_offset = past_end - G_buffer;
size_t old_G_buffer_size = G_buffer_size;
read_size *= 2;
@@ -331,9 +329,6 @@ tac_seekable (int input_fd, const char *file, off_t file_pos)
xalloc_die ();
newbuffer = xrealloc (G_buffer - offset, G_buffer_size);
newbuffer += offset;
- /* Adjust the pointers for the new buffer location. */
- match_start = newbuffer + match_start_offset;
- past_end = newbuffer + past_end_offset;
G_buffer = newbuffer;
}