diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-10-11 18:39:56 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-10-11 18:39:56 +0400 |
commit | dbee2f63ee747b5d4247038f27566bc5aebfe3b7 (patch) | |
tree | c2d60701691ab106e593be24a6974ab7dc0e6fa1 /src/binlog.c | |
parent | b0ce5fefb9e694083846af1e45b09f4baa4b0446 (diff) | |
download | rspamd-dbee2f63ee747b5d4247038f27566bc5aebfe3b7.tar.gz rspamd-dbee2f63ee747b5d4247038f27566bc5aebfe3b7.zip |
Fixes bugs found with clang-static analyser.
Strictly follow c99 standart.
Turn on pedantic c99 checks.
Diffstat (limited to 'src/binlog.c')
-rw-r--r-- | src/binlog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/binlog.c b/src/binlog.c index d3b34b7c0..955ddc68a 100644 --- a/src/binlog.c +++ b/src/binlog.c @@ -361,7 +361,7 @@ binlog_insert (struct rspamd_binlog *log, GTree *nodes) off_t seek; if (!log || !log->metaindex || !log->cur_idx || !nodes) { - msg_info ("improperly opened binlog: %s", log->filename); + msg_info ("improperly opened binlog: %s", log != NULL ? log->filename : "unknown"); return FALSE; } @@ -380,7 +380,7 @@ binlog_insert (struct rspamd_binlog *log, GTree *nodes) /* Check metaindex free space */ if (log->metaindex->last_index < METAINDEX_LEN) { /* Create new index block */ - if ((seek = lseek (log->fd, 0, SEEK_END)) == -1) { + if ((seek = lseek (log->fd, 0, SEEK_END)) == (off_t)-1) { msg_info ("cannot seek in file: %s, error: %s", log->filename, strerror (errno)); return FALSE; } @@ -407,7 +407,7 @@ binlog_sync (struct rspamd_binlog *log, guint64 from_rev, guint64 *from_time, GB gboolean idx_mapped = FALSE, res = TRUE, is_first = FALSE; if (!log || !log->metaindex || !log->cur_idx) { - msg_info ("improperly opened binlog: %s", log->filename); + msg_info ("improperly opened binlog: %s", log != NULL ? log->filename : "unknown"); return FALSE; } |