aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/utils.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-25 18:36:49 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-25 18:36:49 +0100
commit39bf632719bca4005c79dae9f6e3e9f63874ad0e (patch)
treed084b6268e41dbb5aa55a600bfad05faff4c3fd6 /FICS/utils.c
parenta9ff83947cf3bd70fc6fa9cca62c088c17e26a11 (diff)
Reformatted psprintf_highlight()
Diffstat (limited to 'FICS/utils.c')
-rw-r--r--FICS/utils.c32
1 files changed, 19 insertions, 13 deletions
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