Skip to content

Commit 9cf4d5d

Browse files
authored
enh: replace magic number with pre-existing const
1 parent b31c5d8 commit 9cf4d5d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tinyfseq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ enum tf_err_t tf_read_var_header(const uint8_t *bd, int bs, struct tf_var_header
9292
if (bs <= VAR_HEADER_SIZE) {
9393
return TF_EINVALID_VAR_HEADER_SIZE;
9494
} else {
95-
memcpy((unsigned char *) &varHeader->size, &bd[0], 4);
95+
memcpy((unsigned char *) &varHeader->size, &bd[0], VAR_HEADER_SIZE);
9696

9797
// only attempt to read variable value if a decoding buffer (`vd`) is provided
9898
// `.size` already includes the 4 bytes the header consumes

0 commit comments

Comments
 (0)