| Index: core/src/fxcrt/fx_basic_bstring.cpp
|
| diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
|
| index c706912d9da87c2bc226dcb89c30b185f90a2abd..1b9d7a03444dc08b908dff1ac4cc20bea74b3924 100644
|
| --- a/core/src/fxcrt/fx_basic_bstring.cpp
|
| +++ b/core/src/fxcrt/fx_basic_bstring.cpp
|
| @@ -5,6 +5,7 @@
|
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
|
|
| #include <stddef.h> // For offsetof().
|
| +#include <cctype>
|
|
|
| #include "../../include/fxcrt/fx_basic.h"
|
| #include "../../../third_party/base/numerics/safe_math.h"
|
| @@ -493,8 +494,8 @@ void CFX_ByteString::FormatV(const FX_CHAR* lpszFormat, va_list argList) {
|
| }
|
| if (nWidth == 0) {
|
| nWidth = FXSYS_atoi(lpsz);
|
| - for (; (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz++)
|
| - ;
|
| + while (std::isdigit(*lpsz))
|
| + lpsz++;
|
| }
|
| if (nWidth < 0 || nWidth > 128 * 1024) {
|
| lpszFormat = "Bad width";
|
| @@ -509,8 +510,8 @@ void CFX_ByteString::FormatV(const FX_CHAR* lpszFormat, va_list argList) {
|
| lpsz++;
|
| } else {
|
| nPrecision = FXSYS_atoi(lpsz);
|
| - for (; (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz++)
|
| - ;
|
| + while (std::isdigit(*lpsz))
|
| + lpsz++;
|
| }
|
| }
|
| if (nPrecision < 0 || nPrecision > 128 * 1024) {
|
|
|