diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-04-01 19:39:40 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-04-01 19:39:40 +0200 |
commit | 8a18b0b4f989e3c6803f206e7f7be42f16a105a5 (patch) | |
tree | fad425f0db058a7cdeed1e7cd3d726c7dd6bc83a | |
parent | f2cbcee101850f8f251c22b908d9b8e78731d8be (diff) |
Reformatted set_width()
-rw-r--r-- | FICS/variable.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/FICS/variable.c b/FICS/variable.c index 613a79d..d41e17c 100644 --- a/FICS/variable.c +++ b/FICS/variable.c @@ -397,19 +397,22 @@ PRIVATE int set_height(int p, char *var, char *val) return VAR_OK; } -PRIVATE int set_width(int p, char *var, char *val) +PRIVATE int +set_width(int p, char *var, char *val) { - int v = -1; + int v = -1; - if (!val) - return VAR_BADVAL; - if (sscanf(val, "%d", &v) != 1) - return VAR_BADVAL; - if ((v < 32) || (v > 240)) - return VAR_BADVAL; - parray[p].d_width = v; - pprintf(p, "Width set to %d.\n", v); - return VAR_OK; + if (!val) + return VAR_BADVAL; + if (sscanf(val, "%d", &v) != 1) + return VAR_BADVAL; + if (v < 32 || v > 240) + return VAR_BADVAL; + + parray[p].d_width = v; + + pprintf(p, "Width set to %d.\n", v); + return VAR_OK; } PUBLIC char * |