diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-10-11 22:19:00 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-10-11 22:19:00 +0200 |
| commit | 73c2b00a10c5786ddeeacc915e233fd4df1c9321 (patch) | |
| tree | e299ea4e8ac161b2b21170172ff8f182c1c3fe1a /rushs/tinyprintf/io_count_words | |
| parent | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (diff) | |
fix: evalexpr & tinyprintf contenaient toute la piscine
Diffstat (limited to 'rushs/tinyprintf/io_count_words')
| -rw-r--r-- | rushs/tinyprintf/io_count_words/count_words.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/rushs/tinyprintf/io_count_words/count_words.c b/rushs/tinyprintf/io_count_words/count_words.c deleted file mode 100644 index 8b8c9a5..0000000 --- a/rushs/tinyprintf/io_count_words/count_words.c +++ /dev/null @@ -1,33 +0,0 @@ -#include <stdio.h> - -int count_words(const char *file_in) -{ - if (file_in == NULL) - { - return -1; - } - - FILE *f = fopen(file_in, "r"); - if (f == NULL) - { - return -1; - } - - int word = 0; - int count = 0; - int c; - while ((c = fgetc(f)) != EOF) - { - if ((c == ' ' || c == '\n' || c == '\t') && word == 1) - { - word = 0; - } - if (c != ' ' && c != '\n' && c != '\t' && word == 0) - { - word = 1; - count++; - } - } - - return count; -} |
