From 612a264f1dfa99ff5ee6484139c115200f4bc179 Mon Sep 17 00:00:00 2001 From: celest Date: Fri, 1 Apr 2005 08:36:28 +0000 Subject: * Updated ShowMessage functions to use vprintf git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1372 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/showmsg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/common/showmsg.c') diff --git a/src/common/showmsg.c b/src/common/showmsg.c index ddaae3a52..5587e8658 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -1,12 +1,13 @@ #include #include #include +#include #include "showmsg.h" #include "malloc.h" char tmp_output[1024] = {"\0"}; -int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri +int _ShowMessage(enum msg_type flag, const char *string, ...){ // by MC Cameri /* _ShowMessage MUST be used instead of printf as of 10/24/2004. Return: 0 = Successful, 1 = Failed. @@ -14,6 +15,9 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri // int ret = 0; char prefix[40]; char *output; + va_list ap; + + va_start(ap, string); if (strlen(string) <= 0) { ShowError("Empty string passed to _ShowMessage().\n"); return 1; @@ -57,10 +61,12 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri strcpy(output,prefix); strcat(output," "); strcat(output,string); - printf(output); + vprintf(output, ap); fflush(stdout); aFree(output); } + + va_end(ap); /* if ((core_config.debug_output_level > -1) && (flag >= core_config.debug_output_level)) { FILE *fp; -- cgit v1.2.3-70-g09d2