diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-25 18:55:19 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-25 18:55:19 +0100 |
commit | 70f9298f90769a0998afced607d935ff0b1c3605 (patch) | |
tree | e53718497eb3fd5c4e710d69b340f7ee693f00a4 | |
parent | cd7b1e3bddf095116617470b087179c378c2dbc2 (diff) |
Reformatted getword()
-rw-r--r-- | FICS/utils.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/FICS/utils.c b/FICS/utils.c index c4838f2..facefab 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -70,23 +70,27 @@ PUBLIC int iswhitespace(int c) } } -PUBLIC char *getword(char *str) +PUBLIC char * +getword(char *str) { - int i; - static char word[MAX_WORD_SIZE]; - - i = 0; - while (*str && !iswhitespace(*str)) { - word[i] = *str; - str++; - i++; - if (i == MAX_WORD_SIZE) { - i = i - 1; - break; - } - } - word[i] = '\0'; - return word; + int i; + static char word[MAX_WORD_SIZE]; + + i = 0; + + while (*str && !iswhitespace(*str)) { + word[i] = *str; + str++; + i++; + + if (i == MAX_WORD_SIZE) { + i = (i - 1); + break; + } + } + + word[i] = '\0'; + return word; } PUBLIC char * |