2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 03:40:53 +00:00

Replace strchr in QPDF_Name::normalizeName

This commit is contained in:
m-holger 2023-01-30 15:56:29 +00:00 committed by Jay Berkenbilt
parent 3ee552fec5
commit deb1c33086

View File

@ -37,7 +37,10 @@ QPDF_Name::normalizeName(std::string const& name)
// QPDFTokenizer embeds a null character to encode an
// invalid #.
result += "#";
} else if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126)) {
} else if (
ch < 33 || ch == '/' || ch == '(' || ch == ')' || ch == '{' ||
ch == '}' || ch == '<' || ch == '>' || ch == '[' || ch == ']' ||
ch == '%' || ch > 126) {
result += QUtil::hex_encode_char(ch);
} else {
result += ch;