Use the correct string length argument to mj_loadXML.
PiperOrigin-RevId: 531941053 Change-Id: Ia85b779b603a673b8e1d6f22d4bc183311204c4b
This commit is contained in:
committed by
Copybara-Service
parent
770b4b363a
commit
39723891ce
+1
-1
@@ -223,7 +223,7 @@ mjModel* LoadModel(const char* file, mj::Simulate& sim) {
|
||||
mju::strcpy_arr(loadError, "could not load binary model");
|
||||
}
|
||||
} else {
|
||||
mnew = mj_loadXML(filename, nullptr, loadError, mj::Simulate::kMaxFilenameLength);
|
||||
mnew = mj_loadXML(filename, nullptr, loadError, kErrorLength);
|
||||
// remove trailing newline character from loadError
|
||||
if (loadError[0]) {
|
||||
int error_length = mju::strlen_arr(loadError);
|
||||
|
||||
Reference in New Issue
Block a user