1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-13 13:57:19 +00:00

Error on buffer/push-uint16 with non 16 bit unsigned integer.

This commit is contained in:
Calvin Rose
2024-06-15 06:47:47 -05:00
parent 0f60115f27
commit 75710ccabd
5 changed files with 40 additions and 1 deletions

View File

@@ -375,7 +375,7 @@ JANET_CORE_FN(cfun_buffer_push_uint16,
uint16_t data;
uint8_t bytes[2];
} u;
u.data = (uint16_t) janet_getuinteger(argv, 2);
u.data = janet_getuinteger16(argv, 2);
if (reverse) {
uint8_t temp = u.bytes[1];
u.bytes[1] = u.bytes[0];