summaryrefslogtreecommitdiffstats
path: root/usr.bin/split/split.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-12-12 23:09:07 +0000
committermarkm <markm@FreeBSD.org>2001-12-12 23:09:07 +0000
commite006d8bee036793ac728aedff3bf9301a15d581b (patch)
tree8d30fff55b68c7df1524bb1702ef92795d926dc5 /usr.bin/split/split.c
parentd7f873fae92558f30e00d7c936fa5dc1d7d89040 (diff)
downloadFreeBSD-src-e006d8bee036793ac728aedff3bf9301a15d581b.zip
FreeBSD-src-e006d8bee036793ac728aedff3bf9301a15d581b.tar.gz
WARNS=2 fixes, use __FBSDID, remove GCC-specific flags.
Diffstat (limited to 'usr.bin/split/split.c')
-rw-r--r--usr.bin/split/split.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index b31371d..0aea746 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -31,20 +31,18 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1987, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
+#endif
#ifndef lint
-#if 0
-static char sccsid[] = "@(#)split.c 8.2 (Berkeley) 4/16/94";
-#else
-static const char rcsid[] =
- "$FreeBSD$";
+static const char sccsid[] = "@(#)split.c 8.2 (Berkeley) 4/16/94";
#endif
-#endif /* not lint */
#include <sys/param.h>
#include <sys/types.h>
@@ -61,7 +59,7 @@ static const char rcsid[] =
#define DEFLINE 1000 /* Default num lines per file. */
-size_t bytecnt; /* Byte count to split on. */
+int bytecnt; /* Byte count to split on. */
long numlines; /* Line count to split on. */
int file_open; /* If a file open. */
int ifd = -1, ofd = -1; /* Input/output file descriptors. */
@@ -175,8 +173,9 @@ main(argc, argv)
void
split1()
{
- size_t bcnt, dist, len;
+ size_t bcnt;
char *C;
+ int dist, len;
for (bcnt = 0;;)
switch ((len = read(ifd, bfr, MAXBSIZE))) {
@@ -188,7 +187,7 @@ split1()
default:
if (!file_open)
newfile();
- if (bcnt + len >= bytecnt) {
+ if (bcnt + len >= (u_int)bytecnt) {
dist = bytecnt - bcnt;
if (write(ofd, bfr, dist) != dist)
err(EX_IOERR, "write");
@@ -197,7 +196,7 @@ split1()
len -= bytecnt, C += bytecnt) {
newfile();
if (write(ofd,
- C, (int)bytecnt) != bytecnt)
+ C, bytecnt) != bytecnt)
err(EX_IOERR, "write");
}
if (len != 0) {
OpenPOWER on IntegriCloud