diff options
author | asmodai <asmodai@FreeBSD.org> | 2000-04-14 21:01:35 +0000 |
---|---|---|
committer | asmodai <asmodai@FreeBSD.org> | 2000-04-14 21:01:35 +0000 |
commit | e7f9f3a94cc8b0fedca28cad6fd0d3a6c248d6d8 (patch) | |
tree | b02345fd132de34693ac6acd4163514af03359ed /bin/cat/cat.c | |
parent | 60fa3b257bed29aef1b9d419ab002cff0022d050 (diff) | |
download | FreeBSD-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.c | 4 |
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) |