commit 70f9298f90769a0998afced607d935ff0b1c3605 from: Markus Uhlin date: Mon Dec 25 17:55:19 2023 UTC Reformatted getword() commit - cd7b1e3bddf095116617470b087179c378c2dbc2 commit + 70f9298f90769a0998afced607d935ff0b1c3605 blob - c4838f2bc762cb349b76fd1908cbc406cf138f92 blob + facefab25022aa55b8b8dacea55b54123994f183 --- FICS/utils.c +++ 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]; + 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; + 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 *