mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Incorrect Return Code

Open nicholask42 opened this issue 2 years ago • 2 comments

In basic.cc, the main function returns 1 at the end.

https://github.com/deepmind/mujoco/blob/833d30858db7c4588a105199d6993a65842ad563/sample/basic.cc#LL189C10-L189C10

It seems like this return would not be an error. So, shouldn't it be returning 0? Or is it an error if the window is closed and the end of main() is reached?

Also, I would recommend using EXIT_SUCCESS and EXIT_FAILURE instead of 0 or 1.

nicholask42 avatar Jun 08 '23 14:06 nicholask42

Sure, send us a PR.

saran-t avatar Jun 08 '23 14:06 saran-t

Thanks. Just wanted to make sure I was understanding the use of the Mujoco library in the samples. I have created a PR for the changes: https://github.com/deepmind/mujoco/pull/910.

nicholask42 avatar Jun 08 '23 15:06 nicholask42