From faa252f37bcf29f1dbdd8f546c51450ba87d0cef Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 20 Oct 2006 14:02:28 +0000 Subject: [PATCH] Filter all prints, not just ones from a game source. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2416 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- fteqtv/control.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/fteqtv/control.c b/fteqtv/control.c index 2a287d24c..c027ab674 100644 --- a/fteqtv/control.c +++ b/fteqtv/control.c @@ -479,12 +479,38 @@ int main(int argc, char **argv) void Sys_Printf(cluster_t *cluster, char *fmt, ...) { va_list argptr; - char string[2024]; + char string[2048]; + unsigned char *t; va_start (argptr, fmt); - vsnprintf (string, sizeof(string), fmt,argptr); + vsnprintf (string, sizeof(string)-1, fmt,argptr); + string[sizeof(string)-1] = 0; va_end (argptr); + for (t = (unsigned char*)string; *t; t++) + { + if (*t >= 146 && *t < 156) + *t = *t - 146 + '0'; + if (*t == 143) + *t = '.'; + if (*t == 157 || *t == 158 || *t == 159) + *t = '-'; + if (*t >= 128) + *t -= 128; + if (*t == 16) + *t = '['; + if (*t == 17) + *t = ']'; + if (*t == 29) + *t = '-'; + if (*t == 30) + *t = '-'; + if (*t == 31) + *t = '-'; + if (*t == '\a') //doh. :D + *t = ' '; + } + printf("%s", string); }