From c4ae4dffb68bbb6a3fec7a42b886c1a397658297 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 1 Apr 2024 22:04:55 +0200 Subject: Reformatted set_boolean_var() --- FICS/variable.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'FICS/variable.c') diff --git a/FICS/variable.c b/FICS/variable.c index 0f74d72..1ec48d7 100644 --- a/FICS/variable.c +++ b/FICS/variable.c @@ -47,28 +47,31 @@ #include #endif -PRIVATE int set_boolean_var(int *var, char *val) -{ - int v = -1; - - if (val == NULL) - return (*var = !*var); - - if (sscanf(val, "%d", &v) != 1) { - stolower(val); - if (!strcmp(val, "off")) - v = 0; - if (!strcmp(val, "false")) - v = 0; - if (!strcmp(val, "on")) - v = 1; - if (!strcmp(val, "true")) - v = 1; - } - if ((v == 0) || (v == 1)) - return (*var = v); - else - return (-1); +PRIVATE int +set_boolean_var(int *var, char *val) +{ + int v = -1; + + if (val == NULL) + return (*var = !*var); + + if (sscanf(val, "%d", &v) != 1) { + stolower(val); + + if (!strcmp(val, "off")) + v = 0; + if (!strcmp(val, "false")) + v = 0; + if (!strcmp(val, "on")) + v = 1; + if (!strcmp(val, "true")) + v = 1; + } + + if (v == 0 || v == 1) + return (*var = v); + else + return (-1); } PRIVATE int -- cgit v1.2.3