tweak: use else if instead of wrapped else, if

+formatting
This commit is contained in:
NunoSempere 2023-09-15 12:19:40 +03:00
parent 926eab1a9b
commit c3ac29d887
4 changed files with 15 additions and 17 deletions

BIN
src/wc

Binary file not shown.

View File

@ -8,12 +8,10 @@ int wc(FILE* fp)
while ((c = getc(fp)) != EOF) {
if (c != ' ' && c != '\n' && c != '\t') {
word = 1;
} else {
if (word) {
} else if (word) {
num_words++;
word = 0;
}
}
}
num_words += word;
printf("%i\n", num_words);