diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-11-20 22:20:25 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-11-20 22:20:25 +0100 |
commit | 42e5857a7b042d3756463ec151b41c202cb7e2d7 (patch) | |
tree | ef26b47eaa113e880ffc1b1e549bebec966a296e | |
parent | 63fdfba44a4509947823fc0e10ce3213bbb81b33 (diff) |
Added width spec, found by PVS-Studio
-rw-r--r-- | FICS/eco.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); |