Skip to content

Commit

Permalink
Changing hard coded default port value and improving string allocation (
Browse files Browse the repository at this point in the history
  • Loading branch information
danthony06 authored May 10, 2024
1 parent d3f7d23 commit 8af504f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gpsd_client/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ namespace gpsd_client
publish_period_ms = std::chrono::milliseconds{(int)(1000 / publish_rate_)};

std::string host = "localhost";
int port = 2947;
int port = atoi(DEFAULT_GPSD_PORT);
this->get_parameter_or("host", host, host);
this->get_parameter_or("port", port, port);

char port_s[12];
snprintf(port_s, 12, "%d", port);
snprintf(port_s, sizeof(port_s), "%d", port);

gps_data_t* resp = nullptr;

Expand Down

0 comments on commit 8af504f

Please sign in to comment.