summaryrefslogtreecommitdiff
path: root/src/core/log.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-05-18 08:46:56 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-05-18 08:46:56 +0000
commitae25925a1fdceeddff25076b5ff557e14f1aa4cb (patch)
tree7c417ca056f58f2720c41c1493f41ad3ed3d4fc7 /src/core/log.c
parenta0aa6493682fc7b12a83352857abd3697a1ea677 (diff)
downloadirssi-ae25925a1fdceeddff25076b5ff557e14f1aa4cb.zip
Some logging fixes. Flood checking had a memory leak. Query had a small
memory leak. Text buffer fixes. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@226 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/log.c')
-rw-r--r--src/core/log.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/log.c b/src/core/log.c
index 15d0a3f1..863c5f79 100644
--- a/src/core/log.c
+++ b/src/core/log.c
@@ -45,6 +45,9 @@ static void log_write_timestamp(int handle, const char *format, const char *suff
struct tm *tm;
char str[256];
+ g_return_if_fail(format != NULL);
+ if (*format == '\0') return;
+
tm = localtime(&t);
str[sizeof(str)-1] = '\0';
@@ -74,7 +77,10 @@ int log_start_logging(LOG_REC *log)
log->handle = open(fname, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
g_free(str);
- if (log->handle == -1) return FALSE;
+ if (log->handle == -1) {
+ signal_emit("log create failed", 1, log);
+ return FALSE;
+ }
#ifdef HAVE_FCNTL
memset(&lock, 0, sizeof(lock));
lock.l_type = F_WRLCK;
@@ -317,7 +323,7 @@ void log_close(LOG_REC *log)
g_free(log);
}
-static void sig_printtext_stripped(void *server, const char *item, gpointer levelp, const char *str)
+static void sig_printtext_stripped(void *window, void *server, const char *item, gpointer levelp, const char *str)
{
int level;