mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Make sure relevant std::stringstreams are set to binary
This commit is contained in:
parent
766e885a1b
commit
75bf9b75ca
17 changed files with 54 additions and 66 deletions
|
@ -248,7 +248,7 @@ std::string serializeJsonStringIfNeeded(const std::string &s)
|
|||
|
||||
std::string deSerializeJsonStringIfNeeded(std::istream &is)
|
||||
{
|
||||
std::ostringstream tmp_os;
|
||||
std::stringstream tmp_os(std::ios_base::binary | std::ios_base::in | std::ios_base::out);
|
||||
bool expect_initial_quote = true;
|
||||
bool is_json = false;
|
||||
bool was_backslash = false;
|
||||
|
@ -280,8 +280,7 @@ std::string deSerializeJsonStringIfNeeded(std::istream &is)
|
|||
expect_initial_quote = false;
|
||||
}
|
||||
if (is_json) {
|
||||
std::istringstream tmp_is(tmp_os.str(), std::ios::binary);
|
||||
return deSerializeJsonString(tmp_is);
|
||||
return deSerializeJsonString(tmp_os);
|
||||
}
|
||||
|
||||
return tmp_os.str();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue