From f2590398cc1c844b5d12a31502edbe7aab37bb00 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Tue, 19 Nov 2024 21:55:50 +0100 Subject: plogins: added width spec --- FICS/comproc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'FICS') diff --git a/FICS/comproc.c b/FICS/comproc.c index f5c4c9f..266a623 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -744,9 +744,12 @@ plogins(int p, char *fname) return COM_OK; } + _Static_assert(19 < ARRAY_SIZE(ipstr), "'ipstr' too small"); + _Static_assert(19 < ARRAY_SIZE(loginName), "'loginName' too small"); + while (!feof(fp)) { - if (fscanf(fp, "%d %s %ld %d %s\n", &inout, loginName, &lval, - ®istered, ipstr) != 5) { + if (fscanf(fp, "%d %19s %ld %d %19s\n", &inout, loginName, + &lval, ®istered, ipstr) != 5) { fprintf(stderr, "FICS: Error in login info format. " "%s\n", fname); fclose(fp); -- cgit v1.2.3