X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/db9af98fd5699ef5b61444132adc82cb6123882a..44af5dc12b5700bd941fa0b087845e097ab625fa:/uip/mhfixmsg.c diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 7fd7caa9..e9584593 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -2522,12 +2522,9 @@ fix_always (CT ct, int *message_mods) { */ static int fix_filename_param (char *name, char *value, PM *first_pm, PM *last_pm) { - size_t value_len; int fixed = 0; - if (((value_len = strlen (value)) > 0) && - strncmp (value, "=?", 2) == 0 && - strncmp (&value[value_len - 2], "?=", 2) == 0) { + if (HasPrefix(value, "=?") && HasSuffix(value, "?=")) { /* Looks like an RFC 2047 encoded parameter. */ char decoded[PATH_MAX + 1]; @@ -2598,8 +2595,8 @@ fix_filename_encoding (CT ct) { const char *const new_params = concat (params, "\n", NULL); replace_substring (&hf->value, semicolon_loc, new_params); - free ((char *) new_params); - free ((char *) params); + free((void *)new_params); /* Cast away const. Sigh. */ + free((void *)params); } else { advise (NULL, "did not find semicolon in %s:%s\n", hf->name, hf->value);