Skip to content

Commit

Permalink
initialize itemCount and null check
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheirs committed Nov 19, 2021
1 parent c265a4d commit 3d9da6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deps/ledger-zxlib/app/common/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void h_paging_init() {
viewdata.itemIdx = 0;
viewdata.pageIdx = 0;
viewdata.pageCount = 1;
viewdata.itemCount = 0xFF;
}

bool h_paging_can_increase() {
Expand Down Expand Up @@ -185,6 +186,11 @@ zxerr_t h_review_update_data() {
return zxerr_no_data;
}

if (viewdata.viewfuncGetItem == NULL) {
zemu_log_stack("h_review_update_data - GetItem==NULL");
return zxerr_no_data;
}

char buffer[20];
snprintf(buffer, sizeof(buffer), "update Idx %d/%d", viewdata.itemIdx, viewdata.pageIdx);
zemu_log_stack(buffer);
Expand Down

0 comments on commit 3d9da6b

Please sign in to comment.