diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-05 18:20:22 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-05 18:20:22 +0000 |
commit | 1e08514471896e3b3069cdc25f457036d257cc68 (patch) | |
tree | b591aa5d3eac5fec70d137d664ccc4b95db63cc4 /src/client | |
parent | 9068c5040e2737ce70f0cc9498000efa30c14c74 (diff) | |
download | rspamd-1e08514471896e3b3069cdc25f457036d257cc68.tar.gz rspamd-1e08514471896e3b3069cdc25f457036d257cc68.zip |
Fix potential issues as found by coverity.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/rspamc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c index f114997cf..42b995630 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -567,9 +567,8 @@ rspamc_uptime_output (ucl_object_t *obj) hours = seconds / 3600; minutes = seconds / 60 - hours * 60; seconds -= hours * 3600 + minutes * 60; - rspamd_printf ("%L hour%s %L minute%s %L second%s\n", hours, - hours > 1 ? "s" : "", minutes, - minutes > 1 ? "s" : "", + rspamd_printf ("%L hour %L minute%s %L second%s\n", hours, + minutes, minutes > 1 ? "s" : "", seconds, seconds > 1 ? "s" : ""); } } @@ -678,9 +677,12 @@ rspamc_stat_statfile (const ucl_object_t *obj, GString *out) else { rspamd_printf_gstring (out, "Statfile: %s ", symbol); } - rspamd_printf_gstring (out, "length: %HL; free blocks: %HL; total blocks: %HL; " - "free: %.2f%%; learned: %L\n", size, blocks - used_blocks, blocks, - (blocks - used_blocks) * 100.0 / (gdouble)blocks, version); + + if (blocks != 0) { + rspamd_printf_gstring (out, "length: %HL; free blocks: %HL; total blocks: %HL; " + "free: %.2f%%; learned: %L\n", size, blocks - used_blocks, blocks, + (blocks - used_blocks) * 100.0 / (gdouble)blocks, version); + } } static void |