diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-31 07:50:20 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-31 07:50:20 -0400 |
commit | 2519e80b677156ccc4327de1396f88e0097ac3cf (patch) | |
tree | 40ab24614620d63185ed8251c7b06d0ddec145aa | |
parent | 49cfebf2e3ac37624acdbd343809530c0cea9aa3 (diff) |
removed more fixed-width strings
-rw-r--r-- | menus.c | 36 |
1 files changed, 19 insertions, 17 deletions
@@ -947,34 +947,38 @@ void Menu_Update_Display(void) LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; + gchar *ctrl_str = NULL; + switch (globals.control_mode) { - case LOCS_ctrl: - strcpy(LCD_string,"LOCAL CTRL "); - break; - case LWLS_ctrl: - strcpy(LCD_string,"LOCAL LOCK "); - break; case REMS_ctrl: - strcpy(LCD_string,"GPIB CTRL "); + ctrl_str = g_strdup ("GPIB CTRL "); break; case RWLS_ctrl: - strcpy(LCD_string,"GPIB LOCK "); + ctrl_str = g_strdup ("GPIB LOCK "); break; case RS232_ctrl: - strcpy(LCD_string,"RS232 CTRL "); + ctrl_str = g_strdup ("RS232 CTRL "); break; case WEB_ctrl: - strcpy(LCD_string,"WEB CTRL "); + ctrl_str = g_strdup ("WEB CTRL "); break; case TELNET_ctrl: - strcpy(LCD_string,"TELNET CTRL "); + ctrl_str = g_strdup ("TELNET CTRL "); + break; + case LWLS_ctrl: + ctrl_str = g_strdup ("LOCAL LOCK "); + break; + case LOCS_ctrl: + default: + ctrl_str = g_strdup ("LOCAL CTRL "); break; } if (globals.Changes.update_whole_main_menu && Menu_Is_Item_Visible(LCD_entry)) { - LCD_write(LCD_row,LCD_col,LCD_string); + LCD_write(LCD_row,LCD_col,ctrl_str); } + g_free (ctrl_str); /*----- display memory, always -----*/ @@ -986,9 +990,8 @@ void Menu_Update_Display(void) LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; - strcpy(LCD_string,"Memory menu "); if (globals.Changes.update_whole_main_menu && Menu_Is_Item_Visible(LCD_entry)) { - LCD_write(LCD_row,LCD_col,LCD_string); + LCD_write(LCD_row,LCD_col,"Memory menu "); } @@ -1002,9 +1005,8 @@ void Menu_Update_Display(void) LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; - strcpy(LCD_string,"Setup menu "); if (globals.Changes.update_whole_main_menu && Menu_Is_Item_Visible(LCD_entry)) { - LCD_write(LCD_row,LCD_col,LCD_string); + LCD_write(LCD_row,LCD_col,"Setup menu "); } @@ -2486,7 +2488,7 @@ static void Submenu_Service_Encoder(int encoder_change) Float_To_Text(3,abs_Submenu_Value,&num_string); /* isolate the exponent and non-exponent parts */ - expon = g_strdup (num_string+5); + gchar *expon = g_strdup (num_string+5); num_string[5]=0; |