Skip to content

Commit

Permalink
feat: add reply_data_init function
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Oct 11, 2024
1 parent 9c29166 commit 7e16a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net/reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ void _z_reply_data_free(_z_reply_data_t **reply_data) {
}

z_result_t _z_reply_data_copy(_z_reply_data_t *dst, const _z_reply_data_t *src) {
*dst = _z_reply_data_null();
dst->_tag = src->_tag;
*dst = _z_reply_data_init();
if (src->_tag == _Z_REPLY_TAG_DATA) {
_Z_RETURN_IF_ERR(_z_sample_copy(&dst->_result.sample, &src->_result.sample));
} else if (src->_tag == _Z_REPLY_TAG_ERROR) {
_Z_RETURN_IF_ERR(_z_value_copy(&dst->_result.error, &src->_result.error));
}
dst->_tag = src->_tag;
dst->replier_id = src->replier_id;
return _Z_RES_OK;
}
Expand Down

0 comments on commit 7e16a85

Please sign in to comment.