From 70f9298f90769a0998afced607d935ff0b1c3605 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 25 Dec 2023 18:55:19 +0100 Subject: Reformatted getword() --- FICS/utils.c | 36 ++++++++++++++++++++---------------- 1 file 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 * -- cgit v1.2.3