aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFTokenizer.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-01-10 17:52:07 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-01-11 12:51:31 +0100
commit77c31305fe1e9fde7ebf221fca94e7628cbf5a28 (patch)
treed8c035eac3f202e0726654dc59db2a195f663dc6 /libqpdf/QPDFTokenizer.cc
parent0f1ffa1215ae2ca28e9ff9726313853cba021737 (diff)
downloadqpdf-77c31305fe1e9fde7ebf221fca94e7628cbf5a28.tar.zst
Fix signed/unsigned char warning (fixes #604)
Diffstat (limited to 'libqpdf/QPDFTokenizer.cc')
-rw-r--r--libqpdf/QPDFTokenizer.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/libqpdf/QPDFTokenizer.cc b/libqpdf/QPDFTokenizer.cc
index 4217575c..f4439fd1 100644
--- a/libqpdf/QPDFTokenizer.cc
+++ b/libqpdf/QPDFTokenizer.cc
@@ -719,7 +719,7 @@ QPDFTokenizer::findEI(PointerHolder<InputSource> input)
for (std::string::iterator iter = value.begin();
iter != value.end(); ++iter)
{
- signed char ch = *iter;
+ char ch = *iter;
if (((ch >= 'a') && (ch <= 'z')) ||
((ch >= 'A') && (ch <= 'Z')) ||
(ch == '*'))
@@ -729,10 +729,11 @@ QPDFTokenizer::findEI(PointerHolder<InputSource> input)
// alphabetic characters.
found_alpha = true;
}
- else if ((ch < 32) && (! isSpace(ch)))
+ else if ((static_cast<signed char>(ch) < 32) &&
+ (! isSpace(ch)))
{
- // ch is signed, so characters outside of
- // 7-bit will be < 0.
+ // Compare ch as a signed char so characters
+ // outside of 7-bit will be < 0.
found_non_printable = true;
break;
}