projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drop mem_alloc and mem_free, use my own hand crafted optmized macros that
[apps/madmutt.git]
/
rfc2231.c
diff --git
a/rfc2231.c
b/rfc2231.c
index
c3986a4
..
04f9515
100644
(file)
--- a/
rfc2231.c
+++ b/
rfc2231.c
@@
-21,6
+21,8
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "ascii.h"
#include "mime.h"
#include "mutt.h"
#include "ascii.h"
#include "mime.h"
@@
-146,7
+148,7
@@
void rfc2231_decode_parameters (PARAMETER ** headp)
p->attribute = NULL;
p->value = NULL;
p->attribute = NULL;
p->value = NULL;
-
mem_free
(&p);
+
p_delete
(&p);
rfc2231_list_insert (&conthead, conttmp);
}
rfc2231_list_insert (&conthead, conttmp);
}
@@
-171,9
+173,9
@@
static struct rfc2231_parameter *rfc2231_new_parameter (void)
static void rfc2231_free_parameter (struct rfc2231_parameter **p)
{
if (*p) {
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);
}
}
}
}
@@
-331,7
+333,7
@@
int rfc2231_encode_string (char **pd)
++ext;
if (encode) {
++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--)
sprintf (e, "%s''", charset); /* __SPRINTF_CHECKED__ */
t = e + str_len (e);
for (s = d, slen = dlen; slen; s++, slen--)
@@
-345,16
+347,16
@@
int rfc2231_encode_string (char **pd)
*t = '\0';
if (d != *pd)
*t = '\0';
if (d != *pd)
-
mem_free
(&d);
-
mem_free
(pd);
+
p_delete
(&d);
+
p_delete
(pd);
*pd = e;
}
else if (d != *pd) {
*pd = e;
}
else if (d != *pd) {
-
mem_free
(pd);
+
p_delete
(pd);
*pd = d;
}
*pd = d;
}
-
mem_free
(&charset);
+
p_delete
(&charset);
return encode;
}
return encode;
}