n = my_iconv(cd, &f, &flen, &ob, &obl);
if (n == (size_t) (-1) || my_iconv(cd, 0, 0, &ob, &obl) == (size_t) (-1)) {
e = errno;
n = my_iconv(cd, &f, &flen, &ob, &obl);
if (n == (size_t) (-1) || my_iconv(cd, 0, 0, &ob, &obl) == (size_t) (-1)) {
e = errno;
n = convert_string (u, ulen, fromcode, t, &s, &slen);
if (n == (size_t) (-1))
n = convert_string (u, ulen, fromcode, t, &s, &slen);
if (n == (size_t) (-1))
char *s0 = s;
memcpy (s, "=?", 2), s += 2;
char *s0 = s;
memcpy (s, "=?", 2), s += 2;
- memcpy (s, tocode, str_len (tocode)), s += str_len (tocode);
+ memcpy (s, tocode, m_strlen(tocode)), s += m_strlen(tocode);
memcpy (s, "?B?", 3), s += 3;
for (;;) {
if (!dlen)
break;
else if (dlen == 1) {
memcpy (s, "?B?", 3), s += 3;
for (;;) {
if (!dlen)
break;
else if (dlen == 1) {
- *s++ = B64Chars[(*d >> 2) & 0x3f];
- *s++ = B64Chars[((*d & 0x03) << 4) | ((d[1] >> 4) & 0x0f)];
- *s++ = B64Chars[(d[1] & 0x0f) << 2];
+ *s++ = __m_b64chars[(*d >> 2) & 0x3f];
+ *s++ = __m_b64chars[((*d & 0x03) << 4) | ((d[1] >> 4) & 0x0f)];
+ *s++ = __m_b64chars[(d[1] & 0x0f) << 2];
- *s++ = B64Chars[(*d >> 2) & 0x3f];
- *s++ = B64Chars[((*d & 0x03) << 4) | ((d[1] >> 4) & 0x0f)];
- *s++ = B64Chars[((d[1] & 0x0f) << 2) | ((d[2] >> 6) & 0x03)];
- *s++ = B64Chars[d[2] & 0x3f];
+ *s++ = __m_b64chars[(*d >> 2) & 0x3f];
+ *s++ = __m_b64chars[((*d & 0x03) << 4) | ((d[1] >> 4) & 0x0f)];
+ *s++ = __m_b64chars[((d[1] & 0x0f) << 2) | ((d[2] >> 6) & 0x03)];
+ *s++ = __m_b64chars[d[2] & 0x3f];
char *s0 = s;
memcpy (s, "=?", 2), s += 2;
char *s0 = s;
memcpy (s, "=?", 2), s += 2;
- memcpy (s, tocode, str_len (tocode)), s += str_len (tocode);
+ memcpy (s, tocode, m_strlen(tocode)), s += m_strlen(tocode);
memcpy (s, "?Q?", 3), s += 3;
while (dlen--) {
unsigned char c = *d++;
memcpy (s, "?Q?", 3), s += 3;
while (dlen--) {
unsigned char c = *d++;
if (fromcode) {
cd = mutt_iconv_open (tocode, fromcode, 0);
assert (cd != (iconv_t) (-1));
if (fromcode) {
cd = mutt_iconv_open (tocode, fromcode, 0);
assert (cd != (iconv_t) (-1));
- ib = d, ibl = dlen, ob = buf1, obl = sizeof (buf1) - str_len (tocode);
+ ib = d, ibl = dlen, ob = buf1, obl = sizeof (buf1) - m_strlen(tocode);
if (my_iconv(cd, &ib, &ibl, &ob, &obl) == (size_t) (-1) ||
my_iconv(cd, 0, 0, &ob, &obl) == (size_t) (-1)) {
assert (errno == E2BIG);
if (my_iconv(cd, &ib, &ibl, &ob, &obl) == (size_t) (-1) ||
my_iconv(cd, 0, 0, &ob, &obl) == (size_t) (-1)) {
assert (errno == E2BIG);
if (fromcode) {
cd = mutt_iconv_open (tocode, fromcode, 0);
assert (cd != (iconv_t) (-1));
if (fromcode) {
cd = mutt_iconv_open (tocode, fromcode, 0);
assert (cd != (iconv_t) (-1));
- ib = d, ibl = dlen, ob = buf1, obl = sizeof (buf1) - str_len (tocode);
+ ib = d, ibl = dlen, ob = buf1, obl = sizeof (buf1) - m_strlen(tocode);
n1 = my_iconv(cd, &ib, &ibl, &ob, &obl);
n2 = my_iconv(cd, 0, 0, &ob, &obl);
assert (n1 != (size_t) (-1) && n2 != (size_t) (-1));
n1 = my_iconv(cd, &ib, &ibl, &ob, &obl);
n2 = my_iconv(cd, 0, 0, &ob, &obl);
assert (n1 != (size_t) (-1) && n2 != (size_t) (-1));
if (convert_string (d, dlen, fromcode, icode, &u, &ulen)) {
ret = 1;
icode = 0;
if (convert_string (d, dlen, fromcode, icode, &u, &ulen)) {
ret = 1;
icode = 0;
- if (bufpos + wlen + str_len (LINEBREAK) > buflen) {
- buflen = bufpos + wlen + str_len (LINEBREAK);
- mem_realloc (&buf, buflen);
+ if (bufpos + wlen + m_strlen(LINEBREAK) > buflen) {
+ buflen = bufpos + wlen + m_strlen(LINEBREAK);
+ p_realloc(&buf, buflen);
}
r = encode_block (buf + bufpos, t, n, icode, tocode, encoder);
assert (r == wlen);
bufpos += wlen;
}
r = encode_block (buf + bufpos, t, n, icode, tocode, encoder);
assert (r == wlen);
bufpos += wlen;
- memcpy (buf + bufpos, LINEBREAK, str_len (LINEBREAK));
- bufpos += str_len (LINEBREAK);
+ memcpy (buf + bufpos, LINEBREAK, m_strlen(LINEBREAK));
+ bufpos += m_strlen(LINEBREAK);
r = encode_block (buf + bufpos, t, t1 - t, icode, tocode, encoder);
assert (r == wlen);
bufpos += wlen;
memcpy (buf + bufpos, t1, u + ulen - t1);
r = encode_block (buf + bufpos, t, t1 - t, icode, tocode, encoder);
assert (r == wlen);
bufpos += wlen;
memcpy (buf + bufpos, t1, u + ulen - t1);
- rfc2047_encode (*pd, str_len (*pd), col,
+ rfc2047_encode (*pd, m_strlen(*pd), col,
Charset, charsets, &e, &elen,
encode_specials ? RFC822Specials : NULL);
Charset, charsets, &e, &elen,
encode_specials ? RFC822Specials : NULL);
- charset = mem_malloc (t - pp + 1);
- memcpy (charset, pp, t - pp);
- charset[t - pp] = '\0';
+ charset = p_dupstr(pp, t - pp);
if (charset)
mutt_convert_string (&d0, charset, Charset, M_ICONV_HOOK_FROM);
if (charset)
mutt_convert_string (&d0, charset, Charset, M_ICONV_HOOK_FROM);
- dlen = 4 * str_len (s); /* should be enough */
- d = d0 = mem_malloc (dlen + 1);
+ dlen = 4 * m_strlen(s); /* should be enough */
+ d = d0 = p_new(char, dlen + 1);
while (*s && dlen > 0) {
if (!(p = find_encoded_word (s, &q))) {
/* no encoded words */
if (!option (OPTSTRICTMIME)) {
while (*s && dlen > 0) {
if (!(p = find_encoded_word (s, &q))) {
/* no encoded words */
if (!option (OPTSTRICTMIME)) {