diff options
author | m-holger <m-holger@kubitscheck.org> | 2023-01-30 15:11:25 +0100 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2023-02-05 14:29:21 +0100 |
commit | 9096df74fc89614125c00c2eb358c350eea96cdb (patch) | |
tree | b4873275e6982bbd6e68f3540524b461b60f65ab /include | |
parent | 6f15c8e7c50584da6496706d3611a7b48995bd6f (diff) | |
download | qpdf-9096df74fc89614125c00c2eb358c350eea96cdb.tar.zst |
Replace strchr in QUtil::is_hex_digit and is_space
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QUtil.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index 27521a70..dd452026 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -545,13 +545,15 @@ namespace QUtil inline bool 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 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 |