fix: bound remote keypad text

pull/162/head
PhysicistJohn 1 week ago
parent c97938697b
commit 89e5d11e83

@ -955,12 +955,7 @@ VNA_SHELL_FUNCTION(cmd_text)
{
if (argc!= 1)
return;
char *p = argv[0];
char *t = kp_buf;
while (*p) {
*t++ = *p++;
}
*t = 0;
ui_set_keypad_text(argv[0]);
uistat.value = my_atof(kp_buf);
uistat.freq_value = my_atoui(kp_buf);
set_numeric_value();

@ -1593,6 +1593,7 @@ extern const char * const averageText[];
extern uint8_t menu_current_level;
void menu_invoke(int item);
extern char kp_buf[];
void ui_set_keypad_text(const char *text);
void set_numeric_value(void);
void ui_mode_normal(void);

@ -96,6 +96,12 @@ char kp_buf[NUMINPUT_LEN+2]; // !!!!!! WARNING size must be + 2 from NUMINPU
#else
char kp_buf[TXTINPUT_LEN+1]; // !!!!!! WARNING size must be + 2 from NUMINPUT_LEN or TXTINPUT_LEN + 1
#endif
void ui_set_keypad_text(const char *text)
{
plot_printf(kp_buf, sizeof(kp_buf), "%s", text);
}
static uint8_t ui_mode = UI_NORMAL;
static uint8_t keypad_mode;
static char *kp_help_text = NULL;

Loading…
Cancel
Save

Powered by TurnKey Linux.