Replace memmove by strlcpy

This commit is contained in:
Charles-Edouard de la Vergne 2024-03-13 12:13:50 +01:00
parent 710de03cad
commit b4a5c236ea
No known key found for this signature in database
GPG Key ID: F12296941B7BB9C6
2 changed files with 2 additions and 2 deletions

View File

@ -1003,7 +1003,7 @@ const bagl_element_t *ui_menu_main_predisplay(const ux_menu_entry_t *entry,
if (element->component.userid == 0x21) {
memmove(G_gpg_vstate.menu, (void *) (N_gpg_pstate->name.value), 12);
if (G_gpg_vstate.menu[0] == 0) {
memmove(G_gpg_vstate.menu, "<No Name>", 9);
strlcpy(G_gpg_vstate.menu, "<No Name>", 9);
} else {
for (int i = 0; i < 12; i++) {
if (G_gpg_vstate.menu[i] == '<') {

View File

@ -1208,7 +1208,7 @@ 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) {
memmove(G_gpg_vstate.ux_buff1, "<No Name>", 9);
strlcpy(G_gpg_vstate.ux_buff1, "<No Name>", 9);
} else {
for (int i = 0; i < 12; i++) {
if (G_gpg_vstate.ux_buff1[i] == '<') {