aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/playerdb.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index 876aa85..79067ae 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -583,24 +583,28 @@ ReadV1PlayerFmt(int p, player *pp, FILE *fp, char *file, int version)
}
}
+ _Static_assert(1023 < ARRAY_SIZE(tmp2), "Array too small");
+
+#define SCAN_STR "%1023s"
+
while (size_cens--) {
- fscanf(fp, "%s", tmp2);
+ fscanf(fp, SCAN_STR, tmp2);
list_add(p, L_CENSOR, tmp2);
}
while (size_not--) {
- fscanf(fp, "%s", tmp2);
+ fscanf(fp, SCAN_STR, tmp2);
list_add(p, L_NOTIFY, tmp2);
}
while (size_noplay--) {
- fscanf(fp, "%s", tmp2);
+ fscanf(fp, SCAN_STR, tmp2);
list_add(p, L_NOPLAY, tmp2);
}
while (size_gnot--) {
- fscanf(fp, "%s", tmp2);
+ fscanf(fp, SCAN_STR, tmp2);
list_add(p, L_GNOTIFY, tmp2);
}
while (size_chan--) {
- fscanf(fp, "%s", tmp2);
+ fscanf(fp, SCAN_STR, tmp2);
list_add(p, L_CHANNEL, tmp2);
}
}