bore

Unnamed repository
Log | Files | Refs | README

commit 5be17e6aac924783632031feecb1442dc0f75f3d
parent 8d61dae270653f9bd35c8c2bda82c073d917d798
Author: phoebos <ben@bvnf.space>
Date:   Mon, 20 Sep 2021 21:19:39 +0100

cat: use const

Diffstat:
Mcat.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cat.c b/cat.c @@ -7,7 +7,7 @@ #define BUF_SIZE 4096 int -cat(int fd, char *fname) { +cat(int fd, const char *fname) { unsigned char buf[BUF_SIZE]; ssize_t n; while ((n = read(fd, buf, BUF_SIZE)) > 0) { @@ -35,7 +35,7 @@ main(int argc, char **argv) { int fd; int err = 0; - char *fname; + const char *fname; while (*++argv) { if (**argv == '-' && *(*argv + 1) == '\0') {