From 07b55680378925ec8b5014465017e7fa3fa9b556 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Fri, 8 Jun 2018 09:27:53 +1000 Subject: [PATCH] ansi files in strings --- src/bbs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bbs.c b/src/bbs.c index c6affc6..af0e9d0 100644 --- a/src/bbs.c +++ b/src/bbs.c @@ -231,13 +231,24 @@ void timer_handler(int signum) { void s_printf(char *fmt, ...) { char buffer[512]; + int i; + int pos; va_list ap; va_start(ap, fmt); vsnprintf(buffer, 512, fmt, ap); va_end(ap); - s_putstring(buffer); + if (fmt[0] == '@' && fmt[1] == '@' && fmt[strlen(fmt)-1] == '@' && fmt[strlen(fmt)-2] == '@') { + pos = 0; + for (i=2;i