aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-dbhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-dbhash.c')
-rw-r--r--e-util/e-dbhash.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/e-util/e-dbhash.c b/e-util/e-dbhash.c
index 2bcedb8676..e286500066 100644
--- a/e-util/e-dbhash.c
+++ b/e-util/e-dbhash.c
@@ -55,6 +55,13 @@ string_to_dbt(const char *str, DBT *dbt)
dbt->size = strlen (str) + 1;
}
+static void
+md5_to_dbt(const char str[16], DBT *dbt)
+{
+ dbt->data = (void*)str;
+ dbt->size = 16;
+}
+
void
e_dbhash_add (EDbHash *edbh, const gchar *key, const gchar *data)
{
@@ -76,7 +83,7 @@ e_dbhash_add (EDbHash *edbh, const gchar *key, const gchar *data)
/* Data dbt */
md5_get_digest (data, strlen (data), local_hash);
- string_to_dbt (local_hash, &ddata);
+ md5_to_dbt (local_hash, &ddata);
/* Add to database */
db->put (db, &dkey, &ddata, 0);