From 5d9586c148bb31493d6e5c46914668d0a4e61181 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 1 Apr 2024 18:11:28 +0200 Subject: Reformatted set_find() --- FICS/variable.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'FICS/variable.c') 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 -- cgit v1.2.3