diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 21:16:29 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 21:16:29 +0100 |
commit | eaa606a83cf0708f5a7204dfe5f6f907b0a983b3 (patch) | |
tree | 6add7cc66e2817ea9809bf9832b6edf47d1ba857 /FICS | |
parent | 1ff55bdd36abd7bb400da6b366e1723346ebea3c (diff) |
Replaced strcat() calls
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/playerdb.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 5881c02..dbc36a8 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -44,6 +44,10 @@ #include "talkproc.h" #include "utils.h" +#if __linux__ +#include <bsd/string.h> +#endif + PUBLIC player parray[PARRAY_SIZE]; PUBLIC int p_num = 0; @@ -1490,7 +1494,10 @@ player_pend_print(int p, pending *pend) sprintf(tmp, "%s ", parray[pend->whoto].name); } - strcat(outstr, tmp); + if (strlcat(outstr, tmp, sizeof outstr) >= sizeof outstr) { + fprintf(stderr, "FICS: %s: warning: strlcat() truncated\n", + __func__); + } switch (pend->type) { case PEND_MATCH: @@ -1529,7 +1536,11 @@ player_pend_print(int p, pending *pend) break; } - strcat(outstr, tmp); + if (strlcat(outstr, tmp, sizeof outstr) >= sizeof outstr) { + fprintf(stderr, "FICS: %s: warning: strlcat() truncated\n", + __func__); + } + pprintf(p, "%s\n", outstr); } |