Skip to content

Commit

Permalink
ui: better error handling for ui_menu_any_pubaddr_display
Browse files Browse the repository at this point in the history
  • Loading branch information
sgliner-ledger committed Nov 24, 2023
1 parent c6e8717 commit 5bf6ac6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/monero_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int monero_apdu_display_address() {
unsigned char payment_id[8];
unsigned char C[32];
unsigned char D[32];
int error;
int error = 0;

// fetch
monero_io_fetch(index, 8);
Expand Down Expand Up @@ -240,9 +240,9 @@ int monero_apdu_display_address() {
}
}

ui_menu_any_pubaddr_display(0, C, D, (minor | major) ? 1 : 0,
(G_monero_vstate.io_p1 == 1) ? payment_id : NULL);
return 0;
error = ui_menu_any_pubaddr_display(0, C, D, (minor | major) ? 1 : 0,
(G_monero_vstate.io_p1 == 1) ? payment_id : NULL);
return error;
}

/* ----------------------------------------------------------------------- */
Expand Down
5 changes: 4 additions & 1 deletion src/monero_ux_nano.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,10 @@ void ui_menu_pubaddr_display(unsigned int value) {
G_monero_vstate.disp_addr_mode = 0;
G_monero_vstate.disp_addr_M = 0;
G_monero_vstate.disp_addr_m = 0;
ui_menu_any_pubaddr_display(value, G_monero_vstate.A, G_monero_vstate.B, 0, NULL);
int error = ui_menu_any_pubaddr_display(value, G_monero_vstate.A, G_monero_vstate.B, 0, NULL);
if (error) {
app_exit();
}
}

static void exit(void) {
Expand Down

0 comments on commit 5bf6ac6

Please sign in to comment.