From 01348f6f7c7df2da04fe2b890a1c708bd1aab7a1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 15 Nov 2019 20:04:26 +0100 Subject: [PATCH] centralize "const cast" in make_key() --- src/drv_maildir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drv_maildir.c b/src/drv_maildir.c index 3c987a5..9b42efc 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -646,10 +646,10 @@ maildir_validate( const char *box, int create, maildir_store_t *ctx ) #ifdef USE_DB static void -make_key( const char *info_stop, DBT *tkey, char *name ) +make_key( const char *info_stop, DBT *tkey, const char *name ) { char *u = strpbrk( name, info_stop ); - tkey->data = name; + tkey->data = (char *)name; tkey->size = u ? (size_t)(u - name) : strlen( name ); } #endif /* USE_DB */ @@ -830,7 +830,7 @@ maildir_set_uid( maildir_store_t *ctx, const char *name, uint *uid ) return ret; *uid = ++ctx->nuid; - make_key( ((maildir_store_conf_t *)ctx->gen.conf)->info_stop, &key, (char *)name ); + make_key( ((maildir_store_conf_t *)ctx->gen.conf)->info_stop, &key, name ); value.data = uid; value.size = sizeof(*uid); if ((ret = ctx->db->put( ctx->db, 0, &key, &value, 0 ))) { @@ -1737,7 +1737,7 @@ maildir_purge_msg( maildir_store_t *ctx, const char *name ) if ((ret = maildir_uidval_lock( ctx )) != DRV_OK) return ret; - make_key( ((maildir_store_conf_t *)ctx->gen.conf)->info_stop, &key, (char *)name ); + make_key( ((maildir_store_conf_t *)ctx->gen.conf)->info_stop, &key, name ); if ((ret = ctx->db->del( ctx->db, 0, &key, 0 ))) { ctx->db->err( ctx->db, ret, "Maildir error: db->del()" ); return DRV_BOX_BAD;