Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable launching MATLAB desktop from the extern launcher #6366

Merged
merged 14 commits into from
Sep 25, 2023
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Olivier Michel <[email protected]>
nilsjor and omichel authored Sep 19, 2023
commit ed7c5b9ce68018be8403d319fe1f21ff79d9404b
9 changes: 3 additions & 6 deletions src/controller/launcher/webots_controller.c
Original file line number Diff line number Diff line change
@@ -278,12 +278,10 @@ static bool parse_options(int nb_arguments, char **arguments) {
memcpy(robot_name, arguments[i] + 13, robot_name_size);
} else if (strncmp(arguments[i], "--interactive", 13) == 0) {
#ifdef _WIN32
const size_t matlab_args_size = snprintf(NULL, 0, "-wait -r") + 1;
matlab_args = malloc(matlab_args_size);
matlab_args = malloc(strlen("-wait -r") + 1);
sprintf(matlab_args, "-wait -r");
#else
const size_t matlab_args_size = snprintf(NULL, 0, "-r") + 1;
matlab_args = malloc(matlab_args_size);
matlab_args = malloc(strlen("-r") + 1);
sprintf(matlab_args, "-r");
#endif
} else if (strncmp(arguments[i], "--matlab-path=", 14) == 0) {
@@ -901,8 +899,7 @@ int main(int argc, char **argv) {
return -1;

if (!matlab_args) {
const size_t matlab_args_size = snprintf(NULL, 0, "-batch") + 1;
matlab_args = malloc(matlab_args_size);
matlab_args = malloc(strlen("-batch") + 1);
sprintf(matlab_args, "-batch");
} else {
printf("Running MATLAB in interactive mode...\n");