From a4745c6825e0dc10356f8151f969d93345175e8f Mon Sep 17 00:00:00 2001 From: Peter Blom Date: Wed, 27 Jan 2021 15:52:54 +0100 Subject: [PATCH] Simulator: Fix for arg count increase breaking remote host option. The number of arguments was increased by one, see: https://github.com/PX4/PX4-Autopilot/commit/1719ff9892f3c3d034f2b44e94d15527ab09cec6 Because the above commit was merged before https://github.com/PX4/PX4-Autopilot/pull/15443 . It broke support for the remote host option. This has been fixed in this commit by increasing all argv's by one. Signed-off-by: Peter Blom --- src/modules/simulator/simulator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/simulator/simulator.cpp b/src/modules/simulator/simulator.cpp index 7ca1f52f45..38843afa42 100644 --- a/src/modules/simulator/simulator.cpp +++ b/src/modules/simulator/simulator.cpp @@ -79,10 +79,10 @@ int Simulator::start(int argc, char *argv[]) _instance->set_port(atoi(argv[4])); } - if (argc == 5 && strcmp(argv[2], "-t") == 0) { + if (argc == 6 && strcmp(argv[3], "-t") == 0) { _instance->set_ip(InternetProtocol::TCP); - _instance->set_tcp_remote_ipaddr(argv[3]); - _instance->set_port(atoi(argv[4])); + _instance->set_tcp_remote_ipaddr(argv[4]); + _instance->set_port(atoi(argv[5])); } _instance->run();