summaryrefslogtreecommitdiff
path: root/src/tac.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-01-28 13:09:42 +0000
committerJim Meyering <jim@meyering.net>1995-01-28 13:09:42 +0000
commitaf7e99c091afefc228ed50a41a49a729bc294321 (patch)
tree768dc1be963aa8829546b510ffe1bdbcf5af50f3 /src/tac.c
parent9646d4863074f61684cef7226bd1884eea9c34f0 (diff)
downloadcoreutils-af7e99c091afefc228ed50a41a49a729bc294321.tar.xz
(tac): Use memmove instead of bcopy.
(output): Use memcpy instead of bcopy.
Diffstat (limited to 'src/tac.c')
-rw-r--r--src/tac.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tac.c b/src/tac.c
index b13629840..2c629ac0b 100644
--- 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;
}