summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-01-28 13:06:29 +0000
committerJim Meyering <jim@meyering.net>1995-01-28 13:06:29 +0000
commit9646d4863074f61684cef7226bd1884eea9c34f0 (patch)
tree3ef70ad9f8dbd87773969aefcc867bb6c206c353 /src/split.c
parent849868e342cc7b8477ba3a3dbf6f1732f4d08c52 (diff)
downloadcoreutils-9646d4863074f61684cef7226bd1884eea9c34f0.tar.xz
(main): Use memset, not bzero.
(line_bytes_split): Use memmove instead of bcopy.
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/split.c b/src/split.c
index eb3bd15aa..36523c1b1 100644
--- a/src/split.c
+++ b/src/split.c
@@ -259,7 +259,7 @@ main (argc, argv)
strcpy (outfile, outbase);
outfile_mid = outfile + strlen (outfile);
outfile_end = outfile_mid + 2;
- bzero (outfile_mid, 30);
+ memset (outfile_mid, 0, 30);
outfile_mid[0] = 'a';
outfile_mid[1] = 'a' - 1; /* first call to next_file_name makes it an 'a' */
@@ -488,10 +488,11 @@ line_bytes_split (nchars)
cwrite (1, buf, bp - buf);
/* Discard the chars we just output; move rest of chunk
- down to be the start of the next chunk. */
+ down to be the start of the next chunk. Source and
+ destination probably overlap. */
n_buffered -= bp - buf;
if (n_buffered > 0)
- bcopy (bp, buf, n_buffered);
+ memmove (buf, bp, n_buffered);
}
while (!eof);
free (buf);