From 39723891ce44167c80fb817c1e53a318a63abd70 Mon Sep 17 00:00:00 2001 From: Nimrod Gileadi Date: Sun, 14 May 2023 14:39:50 -0700 Subject: [PATCH] Use the correct string length argument to mj_loadXML. PiperOrigin-RevId: 531941053 Change-Id: Ia85b779b603a673b8e1d6f22d4bc183311204c4b --- simulate/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulate/main.cc b/simulate/main.cc index 513c09a5..e3df24c6 100644 --- a/simulate/main.cc +++ b/simulate/main.cc @@ -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);