]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(tac): Use memmove instead of bcopy.
authorJim Meyering <jim@meyering.net>
Sat, 28 Jan 1995 13:09:42 +0000 (13:09 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 28 Jan 1995 13:09:42 +0000 (13:09 +0000)
(output): Use memcpy instead of bcopy.

src/tac.c

index b136298404ccdcb02c72445658a5ae76e352b8fd..2c629ac0b2b08b5e4b98cef7d009caa3d7329069 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -546,8 +546,9 @@ tac (fd, file)
            }
          lseek (fd, file_pos, SEEK_SET);
 
-         /* Shift the pending record data right to make room for the new. */
-         bcopy (buffer, buffer + read_size, saved_record_size);
+         /* Shift the pending record data right to make room for the new.
+            The source and destination regions probably overlap.  */
+         memmove (buffer + read_size, buffer, saved_record_size);
          past_end = buffer + read_size + saved_record_size;
          /* For non-regexp searches, avoid unneccessary scanning. */
          if (sentinel_length)
@@ -608,7 +609,7 @@ output (start, past_end)
   /* Write out as many full buffers as possible. */
   while (bytes_to_add >= bytes_available)
     {
-      bcopy (start, buffer + bytes_in_buffer, bytes_available);
+      memcpy (buffer + bytes_in_buffer, start, bytes_available);
       bytes_to_add -= bytes_available;
       start += bytes_available;
       xwrite (STDOUT_FILENO, buffer, WRITESIZE);
@@ -616,7 +617,7 @@ output (start, past_end)
       bytes_available = WRITESIZE;
     }
 
-  bcopy (start, buffer + bytes_in_buffer, bytes_to_add);
+  memcpy (buffer + bytes_in_buffer, start, bytes_to_add);
   bytes_in_buffer += bytes_to_add;
 }