diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-31 12:56:42 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-31 12:56:42 -0400 |
commit | 8288a2a8515633f48d1ca13e42b76309a8ed53c4 (patch) | |
tree | b9846edddce77d76d26f1f98b29912739801d6bd /menus.c | |
parent | 3a9f6fbafdf08732a2a45f4d815bf6f1fc67f06a (diff) |
remove another fixed-length string
Diffstat (limited to 'menus.c')
-rw-r--r-- | menus.c | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -1046,12 +1046,10 @@ static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,ch return; } + gchar *LCD_string = NULL; gchar *units = NULL; int channel; - char LCD_string[LCD_cols+1]; - LCD_string[0]=0; - channel=Show_What%100; if (Show_What!=Show_No_Number) { @@ -1191,13 +1189,14 @@ static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,ch units = g_strdup(""); } - String_Parameter_To_Text(Submenu_Value,significant_digits,start_string,units,LCD_string,show_plus_sign); + String_Parameter_To_Text(Submenu_Value,significant_digits,start_string,units,&LCD_string,show_plus_sign); } else { - strcpy(LCD_string,start_string); + LCD_string = g_strdup(start_string); } LCD_write_padded_spaces(LCD_row, LCD_col, LCD_string, width_of_column); - + + g_free (LCD_string); g_free (units); } @@ -1598,6 +1597,8 @@ static void Submenu_Display(int change_selection) LCD_write(3,0,Press_Change_Message); if (Submenu_max_entry>0) { + gchar *tmp_str = NULL; //FIXME + char mode_name[Submenu_maximum_entries][LCD_col_width+1]; int current_operating_mode = 0; @@ -1870,10 +1871,12 @@ static void Submenu_Display(int change_selection) break; case mode_amp_min: if (globals.Flash.voltage_enabled[channel]) { - String_Parameter_To_Text(globals.Flash.min_ampl[channel],2,"","V",mode_name[i],YES); + String_Parameter_To_Text(globals.Flash.min_ampl[channel],2,"","V",&tmp_str,YES); } else { - String_Parameter_To_Text(globals.Flash.min_ampl[channel],2,"","A",mode_name[i],YES); + String_Parameter_To_Text(globals.Flash.min_ampl[channel],2,"","A",&tmp_str,YES); } + + strcpy (mode_name[i], tmp_str); // FIXME if (fabs(globals.ChannelState[channel].amplitude-globals.Flash.min_ampl[channel])<globals.Flash.ampl_zero_equiv[channel]) { current_operating_mode=i; @@ -1881,11 +1884,13 @@ static void Submenu_Display(int change_selection) break; case mode_amp_max: if (globals.Flash.voltage_enabled[channel]) { - String_Parameter_To_Text(globals.Flash.max_ampl[channel],2,"","V",mode_name[i],YES); + String_Parameter_To_Text(globals.Flash.max_ampl[channel],2,"","V",&tmp_str,YES); } else { - String_Parameter_To_Text(globals.Flash.max_ampl[channel],2,"","A",mode_name[i],YES); + String_Parameter_To_Text(globals.Flash.max_ampl[channel],2,"","A",&tmp_str,YES); } + strcpy (mode_name[i], tmp_str); // FIXME + if (fabs(globals.ChannelState[channel].amplitude-globals.Flash.max_ampl[channel])<globals.Flash.ampl_zero_equiv[channel]) { current_operating_mode=i; } @@ -1993,7 +1998,8 @@ static void Submenu_Display(int change_selection) if ((base_entry+3) < Submenu_max_entry) { LCD_write(3,39,"\x3"); } - + + g_free (tmp_str); } } |