From 5447af315517c13e724d39272eb741b8e973f091 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Fri, 29 Mar 2024 22:54:26 +0100 Subject: Replaced a sprintf() call with snprintf() --- FICS/matchproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FICS/matchproc.c b/FICS/matchproc.c index ede9084..db6e110 100644 --- a/FICS/matchproc.c +++ b/FICS/matchproc.c @@ -70,7 +70,7 @@ PUBLIC int create_new_match(int white_player, int black_player, int wt, int winc, int bt, int binc, int rated, char *category, char *board, int white) { - char outStr[1024]; + char outStr[1024] = { '\0' }; int g, p; int reverse = 0; @@ -212,7 +212,8 @@ create_new_match(int white_player, int black_player, int wt, int winc, int bt, garray[g].lastDecTime = garray[g].startTime; garray[g].clockStopped = 0; - sprintf(outStr, "\n{Game %d (%s vs. %s) Creating %s %s match.}\n", + snprintf(outStr, sizeof outStr, "\n{Game %d (%s vs. %s) " + "Creating %s %s match.}\n", (g + 1), parray[white_player].name, parray[black_player].name, -- cgit v1.2.3