Skip to content

Commit

Permalink
fix: set timestamp valid only if decode successful
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Oct 14, 2024
1 parent 4e88a66 commit 78d4d66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/protocol/codec/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ z_result_t _z_timestamp_decode(_z_timestamp_t *ts, _z_zbuf_t *zbf) {
_Z_DEBUG("Decoding _TIMESTAMP");
z_result_t ret = _Z_RES_OK;

ts->valid = true;
ret |= _z_zint64_decode(&ts->time, zbf);
ret |= _z_id_decode_as_slice(&ts->id, zbf);

if (ret == _Z_RES_OK) {
ts->valid = true;
}
return ret;
}

Expand Down

0 comments on commit 78d4d66

Please sign in to comment.