summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2022-01-03 17:29:58 +0000
committerLuke Bratch <luke@bratch.co.uk>2022-01-03 17:29:58 +0000
commitc1799538e9bba02ac188c262f051e9bae6e612f8 (patch)
tree3ed277bf697f24d0cf72ffbb06134de328ab9ee5 /config.c
parentd9a27856ab4e3c365ff9755acc6a147c0ae0339d (diff)
Increase maximum auto join channels from 10 to 40, correctly check for maximum configuration array length, correct configuration array debug output text.
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index 3fa28a7..483f88e 100644
--- a/config.c
+++ b/config.c
@@ -198,7 +198,7 @@ int getconfarr(char *confname, char *filename, char dest[MAXCONFARR][MAXDATASIZE
// If we've on the closing brace line, then we're done
if (line[i] == '}') {
for (int i = 0; i < valuecount; i++) {
- debugprint(DEBUG_FULL, "getconfstr(): returning '%s'.\n", dest[i]);
+ debugprint(DEBUG_FULL, "getconfarr(): returning '%s'.\n", dest[i]);
}
// Close fine and return success (or 0 if no values found in an otherwise valid array)
@@ -235,7 +235,7 @@ int getconfarr(char *confname, char *filename, char dest[MAXCONFARR][MAXDATASIZE
}
// If we've found too many values, return an error
- if (valuecount > MAXCONFARR) {
+ if (valuecount > MAXCONFARR - 1) {
snprintf(dest[0], MAXDATASIZE, "Too many elements defined for configuration array '%s', maximum number is '%d'.\n", confname, MAXCONFARR);
fclose(fp);
return -1;