mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-26 22:12:53 -05:00
Improved JSON config error reporting
Show incorrect lines in config.json together with line number and position.
This commit is contained in:
@@ -62,3 +62,14 @@ bool xmrig::Json::save(const char *fileName, const rapidjson::Document &doc)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Json::convertOffset(const char* fileName, size_t offset, size_t& line, size_t& pos, std::vector<std::string>& s)
|
||||
{
|
||||
std::ifstream ifs(fileName, std::ios_base::in | std::ios_base::binary);
|
||||
if (!ifs.is_open()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return convertOffset(ifs, offset, line, pos, s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user