We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7f0262 commit eba7508Copy full SHA for eba7508
src/internal/scratch3reader.cpp
@@ -562,9 +562,11 @@ void Scratch3Reader::read()
562
if (m_zipReader->open()) {
563
// Parse the JSON
564
try {
565
- std::string jsonStr;
566
- m_zipReader->readFileToString("project.json", jsonStr);
567
- m_json = json::parse(jsonStr);
+ char *buf;
+ const size_t size = m_zipReader->readFile("project.json", (void **)&buf);
+ assert(buf);
568
+ m_json = json::parse(buf, buf + size);
569
+ free(buf);
570
} catch (std::exception &e) {
571
printErr("invalid JSON file", e.what());
572
}
0 commit comments