This commit is contained in:
Jakub Melka
2018-12-02 18:41:19 +01:00
parent 2e805b198c
commit 7a96807988
2 changed files with 5 additions and 2 deletions

View File

@ -1925,7 +1925,7 @@ QDateTime PDFEncoding::convertToDateTime(const QByteArray& stream)
for (int i = 0; i < size; ++i) for (int i = 0; i < size; ++i)
{ {
const char currentChar = *it++; const char currentChar = *it++;
if (std::isdigit(currentChar)) if (std::isdigit(static_cast<unsigned char>(currentChar)))
{ {
value = value * 10 + currentChar - '0'; value = value * 10 + currentChar - '0';
} }

View File

@ -93,7 +93,7 @@ PDFLexicalAnalyzer::Token PDFLexicalAnalyzer::fetch()
treatAsReal = true; treatAsReal = true;
real = integer; real = integer;
} }
else if (std::isdigit(lookChar())) else if (std::isdigit(static_cast<unsigned char>(lookChar())))
{ {
atLeastOneDigit = true; atLeastOneDigit = true;
PDFInteger digit = lookChar() - '0'; PDFInteger digit = lookChar() - '0';
@ -257,6 +257,9 @@ PDFLexicalAnalyzer::Token PDFLexicalAnalyzer::fetch()
default: default:
{ {
// Undo fetch char, we do not want to miss first digit
--m_current;
// Try to scan octal value. Octal number can have 3 digits in this case. // Try to scan octal value. Octal number can have 3 digits in this case.
// According to specification, overflow value can be truncated. // According to specification, overflow value can be truncated.
int octalNumber = -1; int octalNumber = -1;