Skip to content

Commit

Permalink
Fix incorrect checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlion committed Oct 31, 2024
1 parent 40d4ded commit dce9d1f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cpp/src/ffi_go/ir/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ auto serializer_create(
void*& ir_serializer_ptr,
ByteSpan* ir_view
) -> int {
if (nullptr == ir_serializer_ptr || nullptr == ir_view) {
if (nullptr != ir_serializer_ptr || nullptr == ir_view) {
return static_cast<int>(std::errc::protocol_error);
}
auto result{clp::ffi::ir_stream::Serializer<encoded_variable_t>::create()};
Expand All @@ -66,6 +66,7 @@ auto serializer_create(
return 0;
}


template <class encoded_variable_t>
auto serialize_log_event(void* ir_serializer, ByteSpan msgpack_bytes, ByteSpan* ir_view) -> int {
if (nullptr == ir_serializer || nullptr == ir_view) {
Expand All @@ -78,7 +79,7 @@ auto serialize_log_event(void* ir_serializer, ByteSpan msgpack_bytes, ByteSpan*
msgpack::unpack(static_cast<char const*>(msgpack_bytes.m_data), msgpack_bytes.m_size)
};
/* if (serializer->serialize_msgpack_map(mp_handle.get())) { */
if (serializer->serialize_msgpack_map(mp_handle.get().via.map)) {
if (false == serializer->serialize_msgpack_map(mp_handle.get().via.map)) {
return static_cast<int>(std::errc::protocol_error);
}

Expand Down
2 changes: 1 addition & 1 deletion ir/writeread_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func testWriteReadLogMessages(
}
_, err := irWriter.WriteLogEvent(event)
if nil != err {
t.Fatalf("ir.Writer.Write failed: %v", err)
t.Fatalf("ir.Writer.WriteLogEvent failed: %v", err)
}
events = append(events, event)
}
Expand Down
Binary file modified lib/libclp_ffi_linux_amd64.a
Binary file not shown.

0 comments on commit dce9d1f

Please sign in to comment.