Skip to content

Commit

Permalink
update BufferIO::GetVal (#2623)
Browse files Browse the repository at this point in the history
  • Loading branch information
salix5 authored Nov 30, 2024
1 parent c1cd59c commit 298b43a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions gframe/bufferio.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,18 @@ class BufferIO {
str[N - 1] = 0;
}
static int GetVal(const wchar_t* pstr) {
unsigned int ret = 0;
while(*pstr >= L'0' && *pstr <= L'9') {
ret = ret * 10 + (*pstr - L'0');
pstr++;
if (*pstr >= L'0' && *pstr <= L'9') {
int ret{};
wchar_t* str_end{};
ret = std::wcstol(pstr, &str_end, 10);
if (*str_end == 0)
return ret;
else
return 0;
}
if (*pstr == 0)
return (int)ret;
return 0;
else
return 0;

}
};

Expand Down

0 comments on commit 298b43a

Please sign in to comment.