diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-07-07 12:54:02 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-07-07 12:54:02 +0200 |
commit | 6b88b740f6b63731064e1d5267c057a6a86e7cf6 (patch) | |
tree | 04e855cb60baccdcb9f0530ee81cd25bafa0303a /FICS/comproc.c | |
parent | 6715f5fcade7dcff9d74b2a24c88d99b8bd03a30 (diff) |
Added parameter 'size' to psprintf_highlight() and replaced unbounded string handling functions
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r-- | FICS/comproc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c index c778502..405a59f 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -845,8 +845,8 @@ who_terse(int p, int num, int *plist, int type) } if (p == p1) { - psprintf_highlight(p, ptmp + strlen(ptmp), "%s", - parray[p1].name); + psprintf_highlight(p, ptmp + strlen(ptmp), + sizeof ptmp - strlen(ptmp), "%s", parray[p1].name); } else { strlcat(ptmp, parray[p1].name, sizeof ptmp); } @@ -909,8 +909,8 @@ who_verbose(int p, int num, int plist[]) if (p == p1) { strlcpy(tmp, " ", sizeof tmp); - psprintf_highlight(p, tmp + strlen(tmp), "%-17s", - p1WithAttrs); + psprintf_highlight(p, tmp + strlen(tmp), + sizeof tmp - strlen(tmp), "%-17s", p1WithAttrs); } else { ret = snprintf(tmp, sizeof tmp, " %-17s", p1WithAttrs); @@ -968,7 +968,8 @@ who_winloss(int p, int num, int plist[]) p1WithAttrs[17] = '\0'; if (p1 == p) { - psprintf_highlight(p, playerLine, "%-17s", p1WithAttrs); + psprintf_highlight(p, playerLine, sizeof playerLine, + "%-17s", p1WithAttrs); } else { snprintf(playerLine, sizeof playerLine, "%-17s", p1WithAttrs); |