From ecf8df8d0bd4ebcf5f0dae9f27fd46e7c770e993 Mon Sep 17 00:00:00 2001 From: David Anthony Date: Fri, 10 May 2024 09:51:52 -0500 Subject: [PATCH] Improving port parameter initialization (#102) --- gpsd_client/src/client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpsd_client/src/client.cpp b/gpsd_client/src/client.cpp index 0c8ff2c..f41fea4 100644 --- a/gpsd_client/src/client.cpp +++ b/gpsd_client/src/client.cpp @@ -23,12 +23,12 @@ class GPSDClient { privnode.param("frame_id", frame_id, frame_id); std::string host = "localhost"; - int port = 2947; + int port = atoi(DEFAULT_GPSD_PORT); privnode.getParam("host", host); privnode.getParam("port", port); char port_s[12]; - snprintf(port_s, 12, "%d", port); + snprintf(port_s, sizeof(port_s), "%d", port); gps_data_t *resp = NULL;