@@ -45,7 +45,7 @@ UniquePublisherId::UniquePublisherId(iox2_unique_publisher_id_h handle)
45
45
46
46
auto UniquePublisherId::bytes () -> iox::optional<RawIdType>& {
47
47
if (!m_raw_id.has_value () && m_handle != nullptr ) {
48
- RawIdType bytes {};
48
+ RawIdType bytes { UNIQUE_PORT_ID_LENGTH, 0 };
49
49
iox2_unique_publisher_id_value (m_handle, bytes.data ());
50
50
m_raw_id.emplace (std::move (bytes));
51
51
}
@@ -92,7 +92,7 @@ UniqueSubscriberId::UniqueSubscriberId(iox2_unique_subscriber_id_h handle)
92
92
93
93
auto UniqueSubscriberId::bytes () -> iox::optional<RawIdType>& {
94
94
if (!m_raw_id.has_value () && m_handle != nullptr ) {
95
- RawIdType bytes {};
95
+ RawIdType bytes { UNIQUE_PORT_ID_LENGTH, 0 };
96
96
iox2_unique_subscriber_id_value (m_handle, bytes.data ());
97
97
m_raw_id.emplace (std::move (bytes));
98
98
}
@@ -138,7 +138,7 @@ UniqueNotifierId::UniqueNotifierId(iox2_unique_notifier_id_h handle)
138
138
139
139
auto UniqueNotifierId::bytes () -> iox::optional<RawIdType>& {
140
140
if (!m_raw_id.has_value () && m_handle != nullptr ) {
141
- RawIdType bytes {};
141
+ RawIdType bytes { UNIQUE_PORT_ID_LENGTH, 0 };
142
142
iox2_unique_notifier_id_value (m_handle, bytes.data ());
143
143
m_raw_id.emplace (std::move (bytes));
144
144
}
@@ -184,7 +184,7 @@ UniqueListenerId::UniqueListenerId(iox2_unique_listener_id_h handle)
184
184
185
185
auto UniqueListenerId::bytes () -> iox::optional<RawIdType>& {
186
186
if (!m_raw_id.has_value () && m_handle != nullptr ) {
187
- RawIdType bytes {};
187
+ RawIdType bytes { UNIQUE_PORT_ID_LENGTH, 0 };
188
188
iox2_unique_listener_id_value (m_handle, bytes.data ());
189
189
m_raw_id.emplace (std::move (bytes));
190
190
}
0 commit comments