2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-08 17:24:06 +00:00

Replace strchr in QUtil::is_hex_digit and is_space

This commit is contained in:
m-holger 2023-01-30 14:11:25 +00:00 committed by Jay Berkenbilt
parent 6f15c8e7c5
commit 9096df74fc

View File

@ -545,13 +545,15 @@ namespace QUtil
inline bool inline bool
QUtil::is_hex_digit(char ch) QUtil::is_hex_digit(char ch)
{ {
return (ch && (strchr("0123456789abcdefABCDEF", ch) != nullptr)); return ('0' <= ch && ch <= '9') || ('a' <= ch && ch <= 'f') ||
('A' <= ch && ch <= 'F');
} }
inline bool inline bool
QUtil::is_space(char ch) QUtil::is_space(char ch)
{ {
return (ch && (strchr(" \f\n\r\t\v", ch) != nullptr)); return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '\f' ||
ch == '\v';
} }
inline bool inline bool