summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/showmsg.c26
-rw-r--r--src/common/showmsg.h4
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 */