]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(tac_stream): Don't perform arithmetic on now-void pointer
authorJim Meyering <jim@meyering.net>
Thu, 8 Jan 1998 22:58:03 +0000 (22:58 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 8 Jan 1998 22:58:03 +0000 (22:58 +0000)
result of xrealloc (until recently it was char*).

src/tac.c

index 2ff2f7f1bc4bbe2b8c499d58a8059effb96b2ac0..95cd30a3e190de2eadb4882cc3eded2909e63b20 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -312,7 +312,8 @@ tac_stream (FILE *in, const char *file)
 
              read_size *= 2;
              G_buffer_size = read_size * 2 + sentinel_length + 2;
-             newbuffer = xrealloc (G_buffer - offset, G_buffer_size) + offset;
+             newbuffer = xrealloc (G_buffer - offset, G_buffer_size);
+             newbuffer += offset;
              /* Adjust the pointers for the new buffer location.  */
              match_start += newbuffer - G_buffer;
              past_end += newbuffer - G_buffer;