aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-01-30 15:11:25 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2023-02-05 14:29:21 +0100
commit9096df74fc89614125c00c2eb358c350eea96cdb (patch)
treeb4873275e6982bbd6e68f3540524b461b60f65ab
parent6f15c8e7c50584da6496706d3611a7b48995bd6f (diff)
downloadqpdf-9096df74fc89614125c00c2eb358c350eea96cdb.tar.zst
Replace strchr in QUtil::is_hex_digit and is_space
-rw-r--r--include/qpdf/QUtil.hh6
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