summaryrefslogtreecommitdiff
path: root/src/common/showmsg.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-01 08:36:28 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-01 08:36:28 +0000
commit612a264f1dfa99ff5ee6484139c115200f4bc179 (patch)
tree4a26df8ab87bf3cb54b6972b9a1c5825b791ac1f /src/common/showmsg.c
parent7bd05bfcac17ad432a430bc385445373174a4862 (diff)
downloadhercules-612a264f1dfa99ff5ee6484139c115200f4bc179.tar.gz
hercules-612a264f1dfa99ff5ee6484139c115200f4bc179.tar.bz2
hercules-612a264f1dfa99ff5ee6484139c115200f4bc179.tar.xz
hercules-612a264f1dfa99ff5ee6484139c115200f4bc179.zip
* Updated ShowMessage functions to use vprintf
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1372 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/showmsg.c')
-rw-r--r--src/common/showmsg.c10
1 files changed, 8 insertions, 2 deletions
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#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;