Index: core/src/fpdftext/fpdf_text.cpp |
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp |
index 9ecbc21bdac06bea0d72dc3a1584b27cb75e3966..3c4a90e59e083d5b7c68066eaa4d1119757226c5 100644 |
--- a/core/src/fpdftext/fpdf_text.cpp |
+++ b/core/src/fpdftext/fpdf_text.cpp |
@@ -4,6 +4,8 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
+#include <cctype> |
+ |
#include "../../../third_party/base/nonstd_unique_ptr.h" |
#include "../../include/fpdfapi/fpdf_page.h" |
#include "../../include/fpdfapi/fpdf_pageobj.h" |
@@ -436,10 +438,8 @@ void NormalizeString(CFX_WideString& str) { |
static FX_BOOL IsNumber(CFX_WideString& str) { |
for (int i = 0; i < str.GetLength(); i++) { |
FX_WCHAR ch = str[i]; |
- if ((ch < '0' || ch > '9') && ch != '-' && ch != '+' && ch != '.' && |
- ch != ' ') { |
+ if (!std::isdigit(ch) && ch != '-' && ch != '+' && ch != '.' && ch != ' ') |
return FALSE; |
- } |
} |
return TRUE; |
} |