aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-25 18:55:19 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-25 18:55:19 +0100
commit70f9298f90769a0998afced607d935ff0b1c3605 (patch)
treee53718497eb3fd5c4e710d69b340f7ee693f00a4 /FICS
parentcd7b1e3bddf095116617470b087179c378c2dbc2 (diff)
Reformatted getword()
Diffstat (limited to 'FICS')
-rw-r--r--FICS/utils.c36
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 *