From 39bf632719bca4005c79dae9f6e3e9f63874ad0e Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 25 Dec 2023 18:36:49 +0100 Subject: Reformatted psprintf_highlight() --- FICS/utils.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'FICS') diff --git a/FICS/utils.c b/FICS/utils.c index e8f4168..7ac57d8 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -282,21 +282,27 @@ PUBLIC void sprintf_dohightlight(int p, char *s) strcat(s, "\033[2m"); } -PUBLIC int psprintf_highlight(int p, char *s, char *format,...) +PUBLIC int +psprintf_highlight(int p, char *s, char *format,...) { - int retval; - va_list ap; + int retval; + va_list ap; - va_start(ap, format); - if (parray[p].highlight) { - sprintf_dohightlight(p, s); - retval = vsprintf(s + strlen(s), format, ap); - strcat(s, "\033[0m"); - } else { - retval = vsprintf(s, format, ap); - } - va_end(ap); - return retval; + if (parray[p].highlight) { + sprintf_dohightlight(p, s); + + va_start(ap, format); + retval = vsprintf(s + strlen(s), format, ap); + va_end(ap); + + strcat(s, "\033[0m"); + } else { + va_start(ap, format); + retval = vsprintf(s, format, ap); + va_end(ap); + } + + return retval; } PUBLIC int -- cgit v1.2.3