Skip to content

Commit

Permalink
Fix Name display
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Mar 13, 2024
1 parent b6305f8 commit 40a85fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/gpg_ux_nanos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,11 +1002,9 @@ const bagl_element_t *ui_menu_main_predisplay(const ux_menu_entry_t *entry,
explicit_bzero(G_gpg_vstate.menu, sizeof(G_gpg_vstate.menu));
if (element->component.userid == 0x21) {
memmove(G_gpg_vstate.menu, (void *) (N_gpg_pstate->name.value), 12);
if (G_gpg_vstate.menu[0] == 0) {
strlcpy(G_gpg_vstate.menu, "<No Name>", 9);
} else {
if (G_gpg_vstate.menu[0] != 0) {
for (int i = 0; i < 12; i++) {
if (G_gpg_vstate.menu[i] == '<') {
if ((G_gpg_vstate.menu[i] == '<') || (G_gpg_vstate.menu[i] == '>')) {
G_gpg_vstate.menu[i] = ' ';
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/gpg_ux_nanox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,11 +1207,9 @@ UX_FLOW(ux_flow_main,
void ui_menu_main_predisplay() {
explicit_bzero(G_gpg_vstate.ux_buff1, sizeof(G_gpg_vstate.ux_buff1));
memmove(G_gpg_vstate.ux_buff1, (void *) (N_gpg_pstate->name.value), 20);
if (G_gpg_vstate.ux_buff1[0] == 0) {
strlcpy(G_gpg_vstate.ux_buff1, "<No Name>", 9);
} else {
if (G_gpg_vstate.ux_buff1[0] != 0) {
for (int i = 0; i < 12; i++) {
if (G_gpg_vstate.ux_buff1[i] == '<') {
if ((G_gpg_vstate.menu[i] == '<') || (G_gpg_vstate.menu[i] == '>')) {
G_gpg_vstate.ux_buff1[i] = ' ';
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gpg_ux_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void ui_init(void) {
memmove(name, (void*) (N_gpg_pstate->name.value), 20);
if (name[0] != 0) {
for (int i = 0; i < 12; i++) {
if (name[i] == '<') {
if ((name[i] == '<') || (name[i] == '>')) {
name[i] = ' ';
}
}
Expand Down

0 comments on commit 40a85fe

Please sign in to comment.