isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 01348f6f7c7df2da04fe2b890a1c708bd1aab7a1
parent 27a1935361f90a72bbb9a625fb6a8e8895d92b13
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Fri, 15 Nov 2019 20:04:26 +0100

centralize "const cast" in make_key()

Diffstat:
Msrc/drv_maildir.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 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;