0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 22:58:04 +03:00

fix channel name bug

This commit is contained in:
OneOfEleven
2023-11-02 22:39:50 +00:00
parent 98a4cd9483
commit 8dfcbedf0b
7 changed files with 36 additions and 24 deletions

View File

@ -538,7 +538,8 @@ void MENU_AcceptSetting(void)
case MENU_MEM_NAME:
{ // trailing trim
for (int i = 9; i >= 0; i--)
int i;
for (i = 9; i >= 0; i--)
{
if (g_edit[i] != ' ' && g_edit[i] != '_' && g_edit[i] != 0x00 && g_edit[i] != 0xff)
break;
@ -547,8 +548,8 @@ void MENU_AcceptSetting(void)
}
// save the channel name
memset(g_tx_vfo->channel_name, 0, sizeof(g_tx_vfo->channel_name));
memcpy(g_tx_vfo->channel_name, g_edit, 10);
memset(&g_tx_vfo->channel_name, 0, sizeof(g_tx_vfo->channel_name));
memcpy(g_tx_vfo->channel_name.name, g_edit, sizeof(g_tx_vfo->channel_name.name));
SETTINGS_save_channel(g_sub_menu_selection, g_eeprom.config.setting.tx_vfo_num, g_tx_vfo, 3);
g_flag_reconfigure_vfos = true;
return;