summaryrefslogtreecommitdiffstats
path: root/bin/cat/cat.c
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2000-04-14 21:01:35 +0000
committerasmodai <asmodai@FreeBSD.org>2000-04-14 21:01:35 +0000
commite7f9f3a94cc8b0fedca28cad6fd0d3a6c248d6d8 (patch)
treeb02345fd132de34693ac6acd4163514af03359ed /bin/cat/cat.c
parent60fa3b257bed29aef1b9d419ab002cff0022d050 (diff)
downloadFreeBSD-src-e7f9f3a94cc8b0fedca28cad6fd0d3a6c248d6d8.zip
FreeBSD-src-e7f9f3a94cc8b0fedca28cad6fd0d3a6c248d6d8.tar.gz
Sync us up to OpenBSD's cat.1 v1.18 and cat.c v1.9.
This gets rid of a bogus cast of NULL in setbuf(). Lets us know the buffer malloc failed. Reworks the manpage a bit to make it more mdoc(7) compliant, adds examples.
Diffstat (limited to 'bin/cat/cat.c')
-rw-r--r--bin/cat/cat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index f88c125..c2f11dd 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -96,7 +96,7 @@ main(argc, argv)
tflag = vflag = 1; /* -t implies -v */
break;
case 'u':
- setbuf(stdout, (char *)NULL);
+ setbuf(stdout, NULL);
break;
case 'v':
vflag = 1;
@@ -249,7 +249,7 @@ raw_cat(rfd)
err(1, "%s", filename);
bsize = MAX(sbuf.st_blksize, 1024);
if ((buf = malloc(bsize)) == NULL)
- err(1, NULL);
+ err(1, "buffer");
}
while ((nr = read(rfd, buf, bsize)) > 0)
for (off = 0; nr; nr -= nw, off += nw)
OpenPOWER on IntegriCloud