Review fixes
This commit is contained in:
@@ -94,7 +94,8 @@ bool handle_eip712_struct_impl(const uint8_t *const apdu_buf) {
|
||||
switch (apdu_buf[OFFSET_P2]) {
|
||||
case P2_IMPL_NAME:
|
||||
// set root type
|
||||
if ((ret = path_set_root((char *) &apdu_buf[OFFSET_CDATA], apdu_buf[OFFSET_LC]))) {
|
||||
ret = path_set_root((char *) &apdu_buf[OFFSET_CDATA], apdu_buf[OFFSET_LC]);
|
||||
if (ret) {
|
||||
if (N_storage.verbose_eip712) {
|
||||
ui_712_review_struct(path_get_root());
|
||||
reply_apdu = false;
|
||||
|
||||
@@ -33,7 +33,8 @@ static bool format_hash_field_type_size(const void *const field_ptr, cx_hash_t *
|
||||
apdu_response_code = APDU_RESPONSE_INVALID_DATA;
|
||||
return false;
|
||||
}
|
||||
if ((uint_str_ptr = mem_alloc_and_format_uint(field_size, &uint_str_len)) == NULL) {
|
||||
uint_str_ptr = mem_alloc_and_format_uint(field_size, &uint_str_len);
|
||||
if (uint_str_ptr == NULL) {
|
||||
apdu_response_code = APDU_RESPONSE_INSUFFICIENT_MEMORY;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ static bool path_depth_list_push(void) {
|
||||
* @return pointer to the hashing context
|
||||
*/
|
||||
static cx_sha3_t *get_last_hash_ctx(void) {
|
||||
return (cx_sha3_t *) mem_alloc(0) - 1;
|
||||
return ((cx_sha3_t *) mem_alloc(0)) - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,7 +111,7 @@ static void sort_dependencies(uint8_t deps_count, const void **deps) {
|
||||
* @param[out] deps_count count of how many struct dependencie pointers
|
||||
* @param[in] first_dep pointer to the first dependency pointer
|
||||
* @param[in] struct_ptr pointer to the struct we are getting the dependencies of
|
||||
* @return \ref false in case of a memory allocation error, \ref true otherwise
|
||||
* @return pointer to the first found dependency, \ref NULL otherwise
|
||||
*/
|
||||
static const void **get_struct_dependencies(uint8_t *const deps_count,
|
||||
const void **first_dep,
|
||||
|
||||
@@ -64,7 +64,7 @@ static void ui_712_set_buf(const char *const src,
|
||||
}
|
||||
memcpy(dst, src, cpy_length);
|
||||
dst[cpy_length] = '\0';
|
||||
if (explicit_trunc && (src_length > dst_length)) {
|
||||
if (explicit_trunc && (cpy_length < src_length)) {
|
||||
memcpy(dst + cpy_length - 3, "...", 3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user