# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "charset.h"
#include "imap_private.h"
char *buf, *p;
int b, ch, k;
- p = buf = mem_malloc (u7len + u7len / 8 + 1);
+ p = buf = p_new(char, u7len + u7len / 8 + 1);
for (; u7len; u7++, u7len--) {
if (*u7 == '&') {
return buf;
bail:
- mem_free (&buf);
+ p_delete(&buf);
return 0;
}
* In the worst case we convert 2 chars to 7 chars. For example:
* "\x10&\x10&..." -> "&ABA-&-&ABA-&-...".
*/
- p = buf = mem_malloc ((u8len / 2) * 7 + 6);
+ p = buf = p_new(char, (u8len / 2) * 7 + 6);
while (u8len) {
unsigned char c = *u8;
}
if (u8len) {
- mem_free (&buf);
+ p_delete(&buf);
return 0;
}
return buf;
bail:
- mem_free (&buf);
+ p_delete(&buf);
return 0;
}
if (!mutt_convert_string (&t, Charset, "UTF-8", 0)) {
char *u7 = utf8_to_utf7 (t, strlen (t), NULL, 0);
- mem_free (s);
+ p_delete(s);
*s = u7;
}
- mem_free (&t);
+ p_delete(&t);
}
}
char *t = utf7_to_utf8 (*s, str_len (*s), 0, 0);
if (t && !mutt_convert_string (&t, "UTF-8", Charset, 0)) {
- mem_free (s);
+ p_delete(s);
*s = t;
}
}