Skip to content

Commit ecf8df8

Browse files
authored
Improving port parameter initialization (#102)
1 parent 6f5963e commit ecf8df8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gpsd_client/src/client.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class GPSDClient {
2323
privnode.param("frame_id", frame_id, frame_id);
2424

2525
std::string host = "localhost";
26-
int port = 2947;
26+
int port = atoi(DEFAULT_GPSD_PORT);
2727
privnode.getParam("host", host);
2828
privnode.getParam("port", port);
2929

3030
char port_s[12];
31-
snprintf(port_s, 12, "%d", port);
31+
snprintf(port_s, sizeof(port_s), "%d", port);
3232

3333
gps_data_t *resp = NULL;
3434

0 commit comments

Comments
 (0)