Skip to content

Commit

Permalink
fix: initialize admin_hash empty
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidPL1 committed Dec 5, 2024
1 parent 1f42d1c commit 9aae6c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mujoco_ros/include/mujoco_ros/mujoco_env.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ class MujocoEnv
int busywait = 0;

// Mode
bool eval_mode = false;
char admin_hash[64];
bool eval_mode = false;
char admin_hash[64] = "\0";

// Atomics for multithread access
std::atomic_int run = { 0 };
Expand Down
3 changes: 3 additions & 0 deletions mujoco_ros/src/mujoco_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ MujocoEnv::MujocoEnv(const std::string &admin_hash /* = std::string()*/)
if (!admin_hash.empty()) {
ROS_WARN("Hash not empty");
mju::strcpy_arr(settings_.admin_hash, admin_hash.c_str());
} else {
// make sure hash is empty and null-terminated
settings_.admin_hash[0] = '\0';
}

ROS_WARN("Getting eval mode...");
Expand Down

0 comments on commit 9aae6c9

Please sign in to comment.