Code auditing weekend results and fixes committing.
[silc.git] / lib / silcutil / silclog.c
index 24f3ddcee748dabba4de0fbc190fdcd09de08bd5..560b3a5df3ac1cf1d95f19cc91e1b35bace9eaa7 100644 (file)
@@ -22,7 +22,7 @@
 #include "silcincludes.h"
 
 /* Set TRUE/FALSE to enable/disable debugging */
-int silc_debug;
+int silc_debug = FALSE;
 
 /* SILC Log name strings. These strings are printed to the log file. */
 const SilcLogTypeName silc_log_types[] =
@@ -55,22 +55,6 @@ static SilcLogCb fatal_cb = NULL;
 static SilcDebugCb debug_cb = NULL;
 static SilcDebugHexdumpCb debug_hexdump_cb = NULL;
 
-/* Formats arguments to a string and returns it after allocating memory
-   for it. It must be remembered to free it later. */
-
-char *silc_log_format(char *fmt, ...)
-{
-  va_list args;
-  static char buf[8192];
-
-  memset(buf, 0, sizeof(buf));
-  va_start(args, fmt);
-  vsnprintf(buf, sizeof(buf) - 1, fmt, args);
-  va_end(args);
-
-  return strdup(buf);
-}
-
 /* Outputs the log message to what ever log file selected. */
 
 void silc_log_output(const char *filename, unsigned int maxsize,
@@ -163,7 +147,6 @@ void silc_log_output_debug(char *file, char *function,
       return;
     }
 
-  /* fprintf(stderr, "%s:%s:%d: %s\n", file, function, line, string); */
   fprintf(stderr, "%s:%d: %s\n", function, line, string);
   fflush(stderr);
   silc_free(string);
@@ -191,7 +174,6 @@ void silc_log_output_hexdump(char *file, char *function,
       return;
     }
 
-  /* fprintf(stderr, "%s:%s:%d: %s\n", file, function, line, string); */
   fprintf(stderr, "%s:%d: %s\n", function, line, string);
   silc_free(string);