{
/* Skip single quoted characters. Strictly these should not occur outside
quoted strings in RFC 822 addresses, but they can in RFC 821 addresses. Pity
about the lack of consistency, isn't it? */
{
/* Skip single quoted characters. Strictly these should not occur outside
quoted strings in RFC 822 addresses, but they can in RFC 821 addresses. Pity
about the lack of consistency, isn't it? */
/* Skip quoted items that are not inside brackets. Note that
quoted pairs are allowed inside quoted strings. */
else if (*s == '\"')
/* Skip quoted items that are not inside brackets. Note that
quoted pairs are allowed inside quoted strings. */
else if (*s == '\"')
/* Skip comments, which may include nested brackets, but quotes
are not recognized inside comments, though quoted pairs are. */
/* Skip comments, which may include nested brackets, but quotes
are not recognized inside comments, though quoted pairs are. */
- while (*(++s) != 0 && (*s != '\n' || !nl_ends))
- {
- if (*s == '\\' && s[1] != 0) s++;
- else if (*s == '(') level++;
- else if (*s == ')' && --level <= 0) { s++; break; }
- }
+ while (*++s && (*s != '\n' || !nl_ends))
+ if (*s == '\\' && s[1])
+ s++;
+ else if (*s == '(')
+ level++;
+ else if (*s == ')' && --level <= 0)
+ { s++; break; }
-parse_quote_2047(const uschar *string, int len, const uschar *charset,
+parse_quote_2047(const uschar * string, int len, const uschar * charset,
- string_fmt_append(NULL, "=?%s?Q?", charset ? charset : US"iso-8859-1");
+ string_fmt_append(NULL, "=?%s?Q?%n", charset ? charset : US"iso-8859-1", &hlen);
{
g = fold ? string_catn(g, US"?=\n ", 4) : string_catn(g, US"?= ", 3);
{
g = fold ? string_catn(g, US"?=\n ", 4) : string_catn(g, US"?= ", 3);
if ((len = Ustrlen(ss)) > 0) /* ignore trailing newlines */
for (const uschar * t = ss + len - 1; t >= ss && *t == '\n'; t--) len--;
*error = string_copyn(ss, len); /* becomes the error */
if ((len = Ustrlen(ss)) > 0) /* ignore trailing newlines */
for (const uschar * t = ss + len - 1; t >= ss && *t == '\n'; t--) len--;
*error = string_copyn(ss, len); /* becomes the error */