Skip to content

Commit

Permalink
SITL: remove superfluous linefeed from panic strings
Browse files Browse the repository at this point in the history
panic adds this within the HAL layer.
  • Loading branch information
peterbarker committed Dec 13, 2024
1 parent 6fb3e27 commit fea17e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions libraries/SITL/SIM_Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ void Frame::load_frame_params(const char *model_json)
} else {
IGNORE_RETURN(asprintf(&fname, "@ROMFS/models/%s", model_json));
if (AP::FS().stat(model_json, &st) != 0) {
AP_HAL::panic("%s failed to load\n", model_json);
AP_HAL::panic("%s failed to load", model_json);
}
}
if (fname == nullptr) {
AP_HAL::panic("%s failed to load\n", model_json);
AP_HAL::panic("%s failed to load", model_json);
}
AP_JSON::value *obj = AP_JSON::load_json(model_json);
if (obj == nullptr) {
AP_HAL::panic("%s failed to load\n", model_json);
AP_HAL::panic("%s failed to load", model_json);
}

enum class VarType {
Expand Down
6 changes: 3 additions & 3 deletions libraries/SITL/SIM_JSON_Master.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ void JSON_Master::init(const int32_t num_slaves)
uint16_t port = 9002 + 10 * i;

if (!list->sock_in.reuseaddress()) {
AP_HAL::panic("JSON master: socket reuseaddress failed on port: %d - %s\n", port, strerror(errno));
AP_HAL::panic("JSON master: socket reuseaddress failed on port: %d - %s", port, strerror(errno));
}

if (!list->sock_in.bind("127.0.0.1", port)) {
AP_HAL::panic("JSON master: socket reuseaddress failed on port: %d - %s\n", port, strerror(errno));
AP_HAL::panic("JSON master: socket reuseaddress failed on port: %d - %s", port, strerror(errno));
}

if (!list->sock_in.set_blocking(false)) {
AP_HAL::panic( "JSON master: socket set_blocking(false) failed on port: %d - %s\n", port, strerror(errno));
AP_HAL::panic( "JSON master: socket set_blocking(false) failed on port: %d - %s", port, strerror(errno));
}

printf("Slave %u: listening on %u\n", list->instance, port);
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_XPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ XPlane::XPlane(const char *frame_str) :
#endif

if (!load_dref_map(XPLANE_JSON)) {
AP_HAL::panic("%s failed to load\n", XPLANE_JSON);
AP_HAL::panic("%s failed to load", XPLANE_JSON);
}
}

Expand Down

0 comments on commit fea17e6

Please sign in to comment.