]> diplodocus.org Git - nmh/commitdiff
Don't need to cast to `char *' for free(3) these days.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Oct 2016 12:44:47 +0000 (13:44 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Oct 2016 12:44:47 +0000 (13:44 +0100)
But still need a cast to discard the const.
Use `void *' as it saves needing to check the original type.

uip/mhfixmsg.c

index 7fd7caa..ee25624 100644 (file)
@@ -2598,8 +2598,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);