X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=rfc2231.c;h=778995b48cf62ae0e833aa684d3d9a8c751b6e8f;hp=6c9d4b5200084fc44896d7dd56c4ad9d87848c7f;hb=1dc7032b59cc5b91d70076ed228bda8caf65a7f3;hpb=ba5e3af4ea19e1d20c80941c077039871ec84258 diff --git a/rfc2231.c b/rfc2231.c index 6c9d4b5..778995b 100644 --- a/rfc2231.c +++ b/rfc2231.c @@ -21,15 +21,16 @@ # include "config.h" #endif +#include + #include "mutt.h" +#include "ascii.h" #include "mime.h" #include "charset.h" #include "lib/str.h" #include "rfc2047.h" #include "rfc2231.h" -#include "lib/mem.h" - #include #include #include @@ -145,7 +146,7 @@ void rfc2231_decode_parameters (PARAMETER ** headp) p->attribute = NULL; p->value = NULL; - mem_free (&p); + p_delete(&p); rfc2231_list_insert (&conthead, conttmp); } @@ -164,15 +165,15 @@ void rfc2231_decode_parameters (PARAMETER ** headp) static struct rfc2231_parameter *rfc2231_new_parameter (void) { - return mem_calloc (sizeof (struct rfc2231_parameter), 1); + return p_new(struct rfc2231_parameter, 1); } static void rfc2231_free_parameter (struct rfc2231_parameter **p) { if (*p) { - mem_free (&(*p)->attribute); - mem_free (&(*p)->value); - mem_free (p); + p_delete(&(*p)->attribute); + p_delete(&(*p)->value); + p_delete(p); } } @@ -271,7 +272,7 @@ static void rfc2231_join_continuations (PARAMETER ** head, vl = str_len (par->value); - mem_realloc (&value, l + vl + 1); + p_realloc(&value, l + vl + 1); strcpy (value + l, par->value); /* __STRCPY_CHECKED__ */ l += vl; @@ -330,7 +331,7 @@ int rfc2231_encode_string (char **pd) ++ext; if (encode) { - e = mem_malloc (dlen + 2 * ext + str_len (charset) + 3); + e = p_new(char, dlen + 2 * ext + str_len(charset) + 3); sprintf (e, "%s''", charset); /* __SPRINTF_CHECKED__ */ t = e + str_len (e); for (s = d, slen = dlen; slen; s++, slen--) @@ -344,16 +345,16 @@ int rfc2231_encode_string (char **pd) *t = '\0'; if (d != *pd) - mem_free (&d); - mem_free (pd); + p_delete(&d); + p_delete(pd); *pd = e; } else if (d != *pd) { - mem_free (pd); + p_delete(pd); *pd = d; } - mem_free (&charset); + p_delete(&charset); return encode; }