Skip to content

Commit e5141b6

Browse files
committed
fixes
1 parent 24a6b74 commit e5141b6

4 files changed

Lines changed: 3 additions & 13 deletions

File tree

app/src/render.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,18 +284,11 @@ parser_error_t render_primitive(parser_context_t *ctx, parser_tx_t *txObj, primi
284284
CHECK_INPUT(txObj);
285285
CHECK_INPUT(outValue);
286286

287-
uint16_t primitive_size = sizeof(primitive);
288-
print_u16("Primitive size: ", primitive_size);
289-
290287
switch (primitive->type) {
291288
case PRIMITIVE_INTEGER:
292-
primitive_size = sizeof(primitive->integer);
293-
print_u16("Primitive size integer_1: ", primitive_size);
294289
CHECK_ERROR(render_integer(ctx, &primitive->integer, outValue, outValueLen));
295290
break;
296291
case PRIMITIVE_BYTE_ARRAY:
297-
primitive_size = sizeof(primitive->byte_array);
298-
print_u16("Primitive size byte_array: ", primitive_size);
299292
CHECK_ERROR(render_byte_array(ctx, txObj, &primitive->byte_array, outValue, outValueLen));
300293
break;
301294
case PRIMITIVE_BYTE_VEC:

app/src/schema_txn_parser.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,12 @@ parser_error_t schema_display_byte_array(parser_context_t *ctx, primitive_byte_a
143143
parser_error_t schema_display_primitive(parser_context_t *ctx, parser_tx_t *txObj, primitive_t *primitive) {
144144
CHECK_INPUT(ctx);
145145

146-
uint16_t primitive_size = sizeof(primitive);
147-
148146
parser_context_t ctx_to_push = {0};
149147
switch (primitive->type) {
150148
case PRIMITIVE_INTEGER:
151-
primitive_size = sizeof(primitive->integer);
152149
CHECK_ERROR(schema_display_integer(ctx, &primitive->integer, &ctx_to_push));
153150
break;
154151
case PRIMITIVE_BYTE_ARRAY:
155-
primitive_size = sizeof(primitive->byte_array);
156152
CHECK_ERROR(schema_display_byte_array(ctx, &primitive->byte_array, &ctx_to_push));
157153
break;
158154
case PRIMITIVE_BYTE_VEC:

app/src/ui_item_buffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ parser_error_t init_item_buffer(item_buffer_t *buffer, const char *initial_data,
4040
buffer->qty = 0;
4141
buffer->initialized = true;
4242
if (initial_data != NULL) {
43-
strncpy(buffer->data, initial_data, strlen(initial_data));
43+
strncpy(buffer->data, initial_data, sizeof(buffer->data) - 1);
44+
buffer->data[sizeof(buffer->data) - 1] = '\0';
4445
if (get_item_buffer_qty(buffer, &buffer->qty) != parser_ok) {
4546
buffer->initialized = false;
4647
return parser_ui_buffer_init_failed;

app/src/ui_item_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ parser_error_t create_item_title(uint16_t index_start, uint16_t index_end, char
9494
return parser_ui_item_title_empty;
9595
}
9696

97-
for (uint8_t i = index_start; i < index_end; i++) {
97+
for (uint16_t i = index_start; i < index_end; i++) {
9898
uint16_t output_str_len = strlen(output);
9999
CHECK_ERROR(get_item_buffer_content(&item_title_buffer, i, output + output_str_len, output_len - output_str_len));
100100
if (i < index_end - 1) {

0 commit comments

Comments
 (0)