projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
imap
/
utf7.c
diff --git
a/imap/utf7.c
b/imap/utf7.c
index
3fa10c7
..
8d7d206
100644
(file)
--- a/
imap/utf7.c
+++ b/
imap/utf7.c
@@
-52,7
+52,7
@@
static char *utf7_to_utf8 (const char *u7, size_t u7len, char **u8,
char *buf, *p;
int b, ch, k;
char *buf, *p;
int b, ch, k;
- p = buf =
safe
_malloc (u7len + u7len / 8 + 1);
+ p = buf =
mem
_malloc (u7len + u7len / 8 + 1);
for (; u7len; u7++, u7len--) {
if (*u7 == '&') {
for (; u7len; u7++, u7len--) {
if (*u7 == '&') {
@@
-113,13
+113,13
@@
static char *utf7_to_utf8 (const char *u7, size_t u7len, char **u8,
if (u8len)
*u8len = p - buf;
if (u8len)
*u8len = p - buf;
-
safe
_realloc (&buf, p - buf);
+
mem
_realloc (&buf, p - buf);
if (u8)
*u8 = buf;
return buf;
bail:
if (u8)
*u8 = buf;
return buf;
bail:
-
FREE
(&buf);
+
mem_free
(&buf);
return 0;
}
return 0;
}
@@
-142,7
+142,7
@@
static char *utf8_to_utf7 (const char *u8, size_t u8len, char **u7,
* In the worst case we convert 2 chars to 7 chars. For example:
* "\x10&\x10&..." -> "&ABA-&-&ABA-&-...".
*/
* In the worst case we convert 2 chars to 7 chars. For example:
* "\x10&\x10&..." -> "&ABA-&-&ABA-&-...".
*/
- p = buf =
safe
_malloc ((u8len / 2) * 7 + 6);
+ p = buf =
mem
_malloc ((u8len / 2) * 7 + 6);
while (u8len) {
unsigned char c = *u8;
while (u8len) {
unsigned char c = *u8;
@@
-206,7
+206,7
@@
static char *utf8_to_utf7 (const char *u8, size_t u8len, char **u7,
}
if (u8len) {
}
if (u8len) {
-
FREE
(&buf);
+
mem_free
(&buf);
return 0;
}
return 0;
}
@@
-219,34
+219,34
@@
static char *utf8_to_utf7 (const char *u8, size_t u8len, char **u7,
*p++ = '\0';
if (u7len)
*u7len = p - buf;
*p++ = '\0';
if (u7len)
*u7len = p - buf;
-
safe
_realloc (&buf, p - buf);
+
mem
_realloc (&buf, p - buf);
if (u7)
*u7 = buf;
return buf;
bail:
if (u7)
*u7 = buf;
return buf;
bail:
-
FREE
(&buf);
+
mem_free
(&buf);
return 0;
}
void imap_utf7_encode (char **s)
{
if (Charset) {
return 0;
}
void imap_utf7_encode (char **s)
{
if (Charset) {
- char *t = s
afe_str
dup (*s);
+ char *t = s
tr_
dup (*s);
if (!mutt_convert_string (&t, Charset, "UTF-8", 0))
if (!mutt_convert_string (&t, Charset, "UTF-8", 0))
- utf8_to_utf7 (t, s
afe_str
len (t), s, 0);
-
FREE
(&t);
+ utf8_to_utf7 (t, s
tr_
len (t), s, 0);
+
mem_free
(&t);
}
}
void imap_utf7_decode (char **s)
{
if (Charset) {
}
}
void imap_utf7_decode (char **s)
{
if (Charset) {
- char *t = utf7_to_utf8 (*s, s
afe_str
len (*s), 0, 0);
+ char *t = utf7_to_utf8 (*s, s
tr_
len (*s), 0, 0);
if (t && !mutt_convert_string (&t, "UTF-8", Charset, 0)) {
if (t && !mutt_convert_string (&t, "UTF-8", Charset, 0)) {
-
FREE
(s);
+
mem_free
(s);
*s = t;
}
}
*s = t;
}
}