Skip to content

Commit

Permalink
fix z_queryable_attachment example
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Sep 25, 2024
1 parent 3f7e3e1 commit d83cfda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/unix/c11/z_queryable_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void query_handler(z_loaned_query_t *query, void *ctx) {
z_bytes_empty(&reply_attachment);
kv_pair_t kvs[1];
z_string_from_str(&kvs[0].key, "reply_key", NULL, NULL);
z_string_from_str(&kvs[1].key, "reply_value", NULL, NULL);
z_string_from_str(&kvs[0].value, "reply_value", NULL, NULL);
z_bytes_writer_t writer = z_bytes_get_writer(z_loan_mut(reply_attachment));
z_bytes_writer_serialize_sequence_begin(&writer, 1);
z_bytes_writer_serialize_string(&writer, z_loan(kvs[0].key));
Expand Down
2 changes: 1 addition & 1 deletion src/api/serialization.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ z_result_t z_bytes_writer_serialize_slice(z_bytes_writer_t *writer, const z_loan
}

z_result_t z_bytes_reader_deserialize_slice(z_bytes_reader_t *reader, z_owned_slice_t *val) {
size_t len;
size_t len = 0;
_Z_RETURN_IF_ERR(z_bytes_reader_deserialize_sequence_begin(reader, &len));
_Z_RETURN_IF_ERR(_z_slice_init(&val->_val, len));
if (z_bytes_reader_read(reader, (uint8_t *)val->_val.start, len) != len) {
Expand Down

0 comments on commit d83cfda

Please sign in to comment.