The charsets parameter is being tokenized by the : delimeter.
The checks against ENCWORD_LEN_MAX and ENCWORD_LEN_MIN make no sense,
and appear to be the result of a large merge a very long time ago
(changeset
cb27682966d5).
I can only guess where this check was supposed to be, but it certainly
doesn't belong here.
q = strchr (p, ':');
n = q ? q - p : strlen (p);
-
- if (!n ||
- /* Assume that we never need more than 12 characters of
- encoded-text to encode a single character. */
- n > (ENCWORD_LEN_MAX - ENCWORD_LEN_MIN + 2 - 12))
+ if (!n)
continue;
t = safe_malloc (n + 1);