This patch fixes the type punning warning by switching from (safe but
perhaps not elegant) casting to using a union.
Thanks to Vincent Lefevre for his input and suggestion to use the union
as a better solution to the problem!
/* Calculate the current hcache version from dynamic configuration */
if (hcachever == 0x0) {
- unsigned char digest[16];
+ union {
+ unsigned char charval[16];
+ unsigned int intval;
+ } digest;
struct md5_ctx ctx;
SPAM_LIST *spam;
RX_LIST *nospam;
}
/* Get a hash and take its bytes as an (unsigned int) hash version */
- md5_finish_ctx(&ctx, digest);
- hcachever = *((unsigned int *)digest);
+ md5_finish_ctx(&ctx, digest.charval);
+ hcachever = digest.intval;
}
h->db = NULL;