aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/eco.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-11-20 22:20:25 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-11-20 22:20:25 +0100
commit42e5857a7b042d3756463ec151b41c202cb7e2d7 (patch)
treeef26b47eaa113e880ffc1b1e549bebec966a296e /FICS/eco.c
parent63fdfba44a4509947823fc0e10ce3213bbb81b33 (diff)
Added width spec, found by PVS-Studio
Diffstat (limited to 'FICS/eco.c')
-rw-r--r--FICS/eco.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/FICS/eco.c b/FICS/eco.c
index 9afe4c7..d7943c0 100644
--- a/FICS/eco.c
+++ b/FICS/eco.c
@@ -27,6 +27,8 @@
#define ECO_MAXFILENAME 1024
#define ECO_MAXTMP 1024
+#define SCAN_FP_AND_ONMOVE "%72[\x21-z] %1s"
+
PRIVATE char *book_dir = DEFAULT_BOOK;
PRIVATE ECO_entry *ECO_book[1096];
@@ -147,7 +149,7 @@ ECO_init(void)
break;
/* XXX */
- sscanf(ptmp, "%[\x21-z] %s", FENpos, onMove);
+ sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove);
(void) strlcat(FENpos, " ", sizeof FENpos);
(void) strlcat(FENpos, onMove, sizeof FENpos);
@@ -206,7 +208,7 @@ NIC_init(void)
feof(fp))
break;
- sscanf(ptmp, "%[\x21-z] %s", FENpos, onMove);
+ sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove);
(void) strlcat(FENpos, " ", sizeof FENpos);
(void) strlcat(FENpos, onMove, sizeof FENpos);
@@ -259,7 +261,7 @@ LONG_init(void)
break;
/* XXX */
- sscanf(ptmp, "%[\x21-z] %s", FENpos, onMove);
+ sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove);
(void) strlcat(FENpos, " ", sizeof FENpos);
(void) strlcat(FENpos, onMove, sizeof FENpos);