Skip to content

Commit c2c7b3c

Browse files
committed
fix: Minor bug
1 parent 82910c4 commit c2c7b3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/inheritance_app/inheritance_encrypt_data.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,8 @@ static bool get_pb_encoded_buffer(
623623
static bool inheritance_send_in_chunks(inheritance_query_t *query,
624624
const uint8_t *buffer,
625625
const size_t buffer_len) {
626-
size_t total_count = ((buffer_len + 1) / ENCRYPTED_CHUNK_SIZE);
626+
size_t total_count =
627+
((buffer_len + ENCRYPTED_CHUNK_SIZE - 1) / ENCRYPTED_CHUNK_SIZE);
627628
size_t remaining_size = (size_t)buffer_len;
628629
size_t offset = 0;
629630
inheritance_result_t result =
@@ -674,6 +675,7 @@ static bool send_encrypted_data(inheritance_query_t *query) {
674675
sizeof(buffer),
675676
&bytes_encoded) ||
676677
!inheritance_send_in_chunks(query, buffer, bytes_encoded)) {
678+
// TODO: throw encryption failed error
677679
return false;
678680
}
679681
return true;

0 commit comments

Comments
 (0)