From 3eecc290f013e7e1aecbf31dfe236436c072e4d0 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 25 Dec 2023 18:31:15 +0100 Subject: Improved pprintf_noformat() --- FICS/utils.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/FICS/utils.c b/FICS/utils.c index 4a5e4b0..6cf0285 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -326,12 +326,9 @@ pprintf_noformat(int p, char *format,...) va_list ap; va_start(ap, format); - retval = vsprintf(tmp, format, ap); + retval = vsnprintf(tmp, sizeof tmp, format, ap); va_end(ap); - if (strlen(tmp) > 10 * MAX_LINE_SIZE) - fprintf(stderr, "FICS: %s: buffer overflow\n", __func__); - net_send_string(parray[p].socket, tmp, 0); return retval; } -- cgit v1.2.3