int size = 0;
header_line *h;
- for (h = header_list; size < header_insert_maxlen && h != NULL; h = h->next)
- {
- if (h->type != htype_old && h->text != NULL) /* NULL => Received: placeholder */
- {
- if (name == NULL || (len <= h->slen && strncmpic(name, h->text, len) == 0))
+ for (h = header_list; size < header_insert_maxlen && h; h = h->next)
+ if (h->type != htype_old && h->text) /* NULL => Received: placeholder */
+ if (!name || (len <= h->slen && strncmpic(name, h->text, len) == 0))
{
int ilen;
uschar *t;
that contains an address list, except when asked for raw headers. Only
need to do this once. */
- if (!want_raw && name != NULL && comma == 0 &&
+ if (!want_raw && name && comma == 0 &&
Ustrchr("BCFRST", h->type) != NULL)
comma = 1;
}
}
}
- }
- }
/* At end of first pass, return NULL if no header found. Then truncate size
if necessary, and get the buffer to hold the data, returning the buffer size.
/* That's all we do for raw header expansion. */
if (want_raw)
- {
*ptr = 0;
- }
/* Otherwise, remove a final newline and a redundant added comma. Then we do
RFC 2047 decoding, translating the charset if requested. The rfc2047_decode2()
{
/* Error from decoder. ipos is unchanged. */
mime_set_anomaly(MIME_ANOMALY_BROKEN_QP);
- *opos = '=';
- ++opos;
+ *opos++ = '=';
++ipos;
}
else if (decode_qp_result == -1)
break;
else if (decode_qp_result >= 0)
- {
- *opos = decode_qp_result;
- ++opos;
- }
+ *opos++ = decode_qp_result;
}
else
- {
- *opos = *ipos;
- ++opos;
- ++ipos;
- }
+ *opos++ = *ipos++;
}
/* something to write? */
len = opos - obuf;
while (*string != 0)
{
- register int ch = *string++;
+ int ch = *string++;
if (ch == '_') *ptr++ = ' ';
else if (ch == '=')
*error = NULL;
mimeword = decode_mimeword(string, lencheck, &q1, &q2, &endword, &dlen, &dptr);
-if (mimeword == NULL)
+if (!mimeword)
{
- if (lenptr != NULL) *lenptr = size;
+ if (lenptr) *lenptr = size;
return string;
}
yield = store_get(++size);
-while (mimeword != NULL)
+while (mimeword)
{
#if HAVE_ICONV
string = endword + 2;
mimeword = decode_mimeword(string, lencheck, &q1, &q2, &endword, &dlen, &dptr);
- if (mimeword != NULL)
+ if (mimeword)
{
uschar *s = string;
while (isspace(*s)) s++;
yield = string_cat(yield, &size, &ptr, string);
yield[ptr] = 0;
-if (lenptr != NULL) *lenptr = ptr;
-if (sizeptr != NULL) *sizeptr = size;
+if (lenptr) *lenptr = ptr;
+if (sizeptr) *sizeptr = size;
return yield;
}