bore

Unnamed repository
Log | Files | Refs | README

commit 8d61dae270653f9bd35c8c2bda82c073d917d798
parent 8db8656ec0a1db4c4c0e0fdac4bf35b4202d2c17
Author: phoebos <ben@bvnf.space>
Date:   Mon, 20 Sep 2021 01:45:39 +0100

meta: actually follow my style guide

Diffstat:
Mcat.c | 6+++---
Mtee.c | 6+++---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cat.c b/cat.c @@ -16,7 +16,7 @@ cat(int fd, char *fname) { return 1; } } - if (n == -1){ + if (n == -1) { fprintf(stderr, "cat: read %s: %s\n", fname, strerror(errno)); return 1; } @@ -25,7 +25,7 @@ cat(int fd, char *fname) { int main(int argc, char **argv) { - if (argc > 1 && **(argv+1) == '-' && *(*(argv+1)+1) == 'u') { + if (argc > 1 && **(argv + 1) == '-' && *(*(argv + 1) + 1) == 'u') { /* ignore -u */ argv++; argc--; @@ -54,7 +54,7 @@ main(int argc, char **argv) { err = 1; continue; } - if (fd != 0 && close(fd) == -1){ + if (fd != 0 && close(fd) == -1) { fprintf(stderr, "cat: close %s: %s\n", fname, strerror(errno)); err = 1; } diff --git a/tee.c b/tee.c @@ -24,7 +24,7 @@ tee(int *fds, int len) { return 1; } } - if (n == -1){ + if (n == -1) { fprintf(stderr, "tee: read: %s\n", strerror(errno)); return 1; } @@ -49,7 +49,7 @@ main(int argc, char **argv) { } argv += optind - 1; - int fds[argc-optind]; + int fds[argc - optind]; int i = 0; while (*++argv) { @@ -64,7 +64,7 @@ main(int argc, char **argv) { err = 1; } while (--i > 0) { - if (close(fds[i]) == -1){ + if (close(fds[i]) == -1) { fprintf(stderr, "tee: close: %s\n", strerror(errno)); err = 1; }