Commit 91865916 authored by Chen Bill's avatar Chen Bill Committed by GitHub

fix signed overflow in BufferIO::GetVal() (#2530)

parent efb11b26
...@@ -128,12 +128,12 @@ public: ...@@ -128,12 +128,12 @@ public:
return wp - wstr; return wp - wstr;
} }
static int GetVal(const wchar_t* pstr) { static int GetVal(const wchar_t* pstr) {
int ret = 0; unsigned int ret = 0;
while(*pstr >= L'0' && *pstr <= L'9') { while(*pstr >= L'0' && *pstr <= L'9') {
ret = ret * 10 + (*pstr - L'0'); ret = ret * 10 + (*pstr - L'0');
pstr++; pstr++;
} }
return ret; return (int)ret;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment