From fd849574416258bad5bb957e583b9a6bf03e31e9 Mon Sep 17 00:00:00 2001 From: Jonathan Bendes Date: Fri, 22 Nov 2024 14:15:21 -0500 Subject: [PATCH] Fixed strings in zcm --- plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp | 4 ++-- plotjuggler_plugins/PluginsZcm/datastream_zcm.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp b/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp index 6c9731f1f..6728dc9fd 100644 --- a/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp +++ b/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp @@ -236,7 +236,7 @@ static void processData(const string& name, zcm_field_type_t type, const void* d v->numerics.emplace_back(name, toDouble(data)); break; case ZCM_FIELD_STRING: - v->strings.emplace_back(name, string((const char*)data)); + v->strings.emplace_back(name, string(*((const char**)data))); break; case ZCM_FIELD_USER_TYPE: assert(false && "Should not be possble"); @@ -269,7 +269,7 @@ bool DataLoadZcm::readDataFromFile(FileLoadInfo* info, PlotDataMapRef& plot_data vector> numerics; vector> strings; - ProcessUsr usr = { numerics, strings }; + ProcessUsr usr { numerics, strings }; auto processEvent = [&](const zcm::LogEvent* evt) { if (_selected_channels.find(evt->channel) == _selected_channels.end()) diff --git a/plotjuggler_plugins/PluginsZcm/datastream_zcm.cpp b/plotjuggler_plugins/PluginsZcm/datastream_zcm.cpp index 131e0c696..d3b090e85 100644 --- a/plotjuggler_plugins/PluginsZcm/datastream_zcm.cpp +++ b/plotjuggler_plugins/PluginsZcm/datastream_zcm.cpp @@ -216,7 +216,7 @@ void DataStreamZcm::processData(const string& name, zcm_field_type_t type, me->_numerics.emplace_back(name, toDouble(data)); break; case ZCM_FIELD_STRING: - me->_strings.emplace_back(name, string((const char*)data)); + me->_strings.emplace_back(name, string(*((const char**)data))); break; case ZCM_FIELD_USER_TYPE: assert(false && "Should not be possble");