Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions surround360_render/source/thirdparty/supereasyjson/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <functional>
#include <stack>
#include <string>
#include <sstream>

#ifndef WIN32
#define _stricmp strcasecmp
Expand Down Expand Up @@ -801,8 +802,13 @@ static Value DeserializeValue(std::string &str, bool *had_error,
else if (has_e || has_dot) {
char *end_char;
errno = 0;
double d = strtod(temp_val.c_str(), &end_char);
if ((errno != 0) || (*end_char != '\0')) {
//double d = strtod(temp_val.c_str(), &end_char);
double d;
std::istringstream istr(temp_val);
istr.imbue(std::locale("en_US.utf8"));
istr >> d;

if ((errno != 0) /*|| (*end_char != '\0')*/) {
// invalid conversion or out of range
*had_error = true;
return Value();
Expand Down