Skip to content

Commit

Permalink
ensure generated strings are always ASCII to respect the UTF8 require…
Browse files Browse the repository at this point in the history
…ment on selectors and keyexprs
  • Loading branch information
p-avital committed Oct 19, 2023
1 parent 4b56443 commit 5a90c01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/z_msgcodec_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ _z_bytes_t gen_bytes(size_t len) {
if (len == 0) return arr;

arr.start = (uint8_t *)z_malloc(sizeof(uint8_t) * len);
for (_z_zint_t i = 0; i < len; i++) ((uint8_t *)arr.start)[i] = gen_uint8();
for (_z_zint_t i = 0; i < len; i++) {
((uint8_t *)arr.start)[i] = gen_uint8() & 0b01111111;
}

return arr;
}
Expand Down

0 comments on commit 5a90c01

Please sign in to comment.