aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/fstring.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-05 18:20:22 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-05 18:20:22 +0000
commit1e08514471896e3b3069cdc25f457036d257cc68 (patch)
treeb591aa5d3eac5fec70d137d664ccc4b95db63cc4 /src/libutil/fstring.c
parent9068c5040e2737ce70f0cc9498000efa30c14c74 (diff)
downloadrspamd-1e08514471896e3b3069cdc25f457036d257cc68.tar.gz
rspamd-1e08514471896e3b3069cdc25f457036d257cc68.zip
Fix potential issues as found by coverity.
Diffstat (limited to 'src/libutil/fstring.c')
-rw-r--r--src/libutil/fstring.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/fstring.c b/src/libutil/fstring.c
index e45b0ded5..96c57131a 100644
--- a/src/libutil/fstring.c
+++ b/src/libutil/fstring.c
@@ -370,11 +370,12 @@ rspamd_fstrhash (rspamd_fstring_t * str)
{
size_t i;
guint32 hval;
- gchar *c = str->begin;
+ gchar *c;
if (str == NULL) {
return 0;
}
+ c = str->begin;
hval = str->len;
for (i = 0; i < str->len; i++, c++) {
@@ -391,13 +392,15 @@ rspamd_fstrhash_lc (rspamd_fstring_t * str, gboolean is_utf)
{
gsize i;
guint32 j, hval;
- const gchar *p = str->begin, *end = NULL;
+ const gchar *p, *end = NULL;
gchar t;
gunichar uc;
if (str == NULL) {
return 0;
}
+
+ p = str->begin;
hval = str->len;
if (is_utf) {