Commit deb1c330869b2785fac8ec3916a67a0ff6916a3d
Committed by
Jay Berkenbilt
1 parent
3ee552fe
Replace strchr in QPDF_Name::normalizeName
Showing
1 changed file
with
4 additions
and
1 deletions
libqpdf/QPDF_Name.cc
| ... | ... | @@ -37,7 +37,10 @@ QPDF_Name::normalizeName(std::string const& name) |
| 37 | 37 | // QPDFTokenizer embeds a null character to encode an |
| 38 | 38 | // invalid #. |
| 39 | 39 | result += "#"; |
| 40 | - } else if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126)) { | |
| 40 | + } else if ( | |
| 41 | + ch < 33 || ch == '/' || ch == '(' || ch == ')' || ch == '{' || | |
| 42 | + ch == '}' || ch == '<' || ch == '>' || ch == '[' || ch == ']' || | |
| 43 | + ch == '%' || ch > 126) { | |
| 41 | 44 | result += QUtil::hex_encode_char(ch); |
| 42 | 45 | } else { |
| 43 | 46 | result += ch; | ... | ... |