Skip to content

Commit 57a6b4b

Browse files
authored
fix: wrap a short-lived keyexpr in a std::string (#359)
1 parent 4b26a58 commit 57a6b4b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rmw_zenoh_cpp/src/detail/rmw_service_data.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ std::shared_ptr<ServiceData> ServiceData::make(
161161
RMW_ZENOH_LOG_ERROR_NAMED(
162162
"rmw_zenoh_cpp",
163163
"Unable to obtain ServiceData from data for %s.",
164-
query.get_keyexpr().as_string_view());
164+
std::string(query.get_keyexpr().as_string_view()).c_str());
165165
return;
166166
}
167167

rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ bool SubscriptionData::init()
208208
RMW_ZENOH_LOG_ERROR_NAMED(
209209
"rmw_zenoh_cpp",
210210
"Unable to obtain SubscriptionData from data for %s.",
211-
sample.get_keyexpr().as_string_view());
211+
std::string(sample.get_keyexpr().as_string_view()).c_str());
212212
return;
213213
}
214214

0 commit comments

Comments
 (0)