commit d75a03956e596040815f317c30e9f95a9993c319
parent 53a5bc51e25a1d59a64c8798868299b86ebc3f4e
Author: phoebos <ben@bvnf.space>
Date: Wed, 22 Sep 2021 22:20:04 +0100
wc: change extraneous tabs to spaces
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/wc.c b/wc.c
@@ -49,15 +49,15 @@ int
wc(struct count *ct, FILE *f) {
int c, in_word = 0;
while ((c = fgetc(f)) != EOF) {
- if (c == '\n')
+ if (c == '\n')
++ct->l;
- if (c == ' ' || c == '\t' || c == '\n')
+ if (c == ' ' || c == '\t' || c == '\n')
in_word=0;
- else if (in_word == 0) {
- in_word = 1;
- ++ct->w;
- }
- ++ct->c;
+ else if (in_word == 0) {
+ in_word = 1;
+ ++ct->w;
+ }
+ ++ct->c;
}
if (ferror(f)) {
fprintf(stderr, "wc: %s\n", strerror(errno));