diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-04-01 18:11:28 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-04-01 18:11:28 +0200 |
commit | 5d9586c148bb31493d6e5c46914668d0a4e61181 (patch) | |
tree | 9cd918e8327fa6061e0c180e947f9b2754c29f89 | |
parent | 3aece1aaef59cb9242fce4c9bd1e1776f7328e1b (diff) |
Reformatted set_find()
-rw-r--r-- | FICS/variable.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/FICS/variable.c b/FICS/variable.c index ecb3dc6..d26036c 100644 --- a/FICS/variable.c +++ b/FICS/variable.c @@ -784,27 +784,29 @@ PUBLIC var_list variables[] = { {NULL, NULL} }; -PRIVATE int set_find(char *var) -{ - int i = 0; - int gotIt = -1; - int len = strlen(var); - - while (variables[i].name) { - if (!strncmp(variables[i].name, var, len)) { - if (len == strlen(variables[i].name)) { - return i; - } else if (gotIt >= 0) { - return -VAR_AMBIGUOUS; - } - gotIt = i; - } - i++; - } - if (gotIt >= 0) { - return gotIt; - } - return -VAR_NOSUCH; +PRIVATE int +set_find(char *var) +{ + int gotIt = -1; + int i = 0; + int len = strlen(var); + + while (variables[i].name) { + if (!strncmp(variables[i].name, var, len)) { + if (len == strlen(variables[i].name)) + return i; + else if (gotIt >= 0) + return -VAR_AMBIGUOUS; + + gotIt = i; + } + + i++; + } + + if (gotIt >= 0) + return gotIt; + return -VAR_NOSUCH; } PUBLIC int |