diff options
author | mc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-27 14:35:37 +0000 |
---|---|---|
committer | mc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-27 14:35:37 +0000 |
commit | 99b156f4ec91f2d52fd57aa1710ae9261b8db356 (patch) | |
tree | 25c8060557acb80f95a0d1ab17f169eeff2282d4 /src/common | |
parent | 56514473a9d504324f3b4bf6b2e062cabd19eadd (diff) | |
download | hercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.tar.gz hercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.tar.bz2 hercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.tar.xz hercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.zip |
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@820 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/showmsg.c | 26 | ||||
-rw-r--r-- | src/common/showmsg.h | 4 |
2 files changed, 14 insertions, 16 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 3488926bf..857a819bb 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -21,11 +21,9 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri case MSG_STATUS: //Bright Green (To inform about good things) strcpy(prefix,CL_GREEN"[Status]"CL_RESET":"); break; -/* //Do we really need this now? [MC Cameri] case MSG_SQL: //Bright Violet (For dumping out anything related with SQL) strcpy(prefix,CL_MAGENTA"[SQL]"CL_RESET":"); break; -*/ case MSG_INFORMATION: //Bright White (Variable information) strcpy(prefix,CL_WHITE"[Info]"CL_RESET":"); break; @@ -49,18 +47,18 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri return 1; } if (!(flag == MSG_DEBUG && !SHOW_DEBUG_MSG)) { - output = (char*)malloc(sizeof(char)*(strlen(prefix)+strlen(string)+2)); // +2: space and a \0 - if (output == NULL) { - return 1; -// exit(1); // Kill server? Deadly - } - - strcpy(output,prefix); - strcat(output," "); - strcat(output,string); - printf(output); - fflush(stdout); - free(output); + output = (char*)malloc(sizeof(char)*(strlen(prefix)+strlen(string)+2)); // prefix+string+two chars(space and \0) + if (output == NULL) { + return 1; +// exit(1); // Kill server? Deadly + } + + strcpy(output,prefix); + strcat(output," "); + strcat(output,string); + printf(output); + fflush(stdout); + free(output); } /* if ((core_config.debug_output_level > -1) && (flag >= core_config.debug_output_level)) { diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 2d40255fb..0949d08e4 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -18,7 +18,7 @@ extern char tmp_output[1024]; -enum msg_type {MSG_STATUS,/* MSG_SQL, */MSG_INFORMATION,MSG_NOTICE,MSG_WARNING,MSG_DEBUG,MSG_ERROR,MSG_FATALERROR}; +enum msg_type {MSG_STATUS, MSG_SQL, MSG_INFORMATION,MSG_NOTICE,MSG_WARNING,MSG_DEBUG,MSG_ERROR,MSG_FATALERROR}; extern int _ShowMessage(const char *string, enum msg_type flag); @@ -32,7 +32,7 @@ extern int _ShowMessage(const char *string, enum msg_type flag); // #define DisplayStatus(string) _ShowMessage(string,MSG_STATUS) /* MSG_SQL*/ -// #define ShowSQL(string) _ShowMessage(string,MSG_SQL) + #define ShowSQL(string) _ShowMessage(string,MSG_SQL) // #define DisplaySQL(string) _ShowMessage(string,MSG_SQL) /* MSG_INFORMATION */ |