aoview_serial_close(monitor_serial);
monitor_serial = NULL;
}
- aoview_table_clear();
aoview_log_new();
}
static struct aostate state;
gboolean
-aoview_monitor_parse(char *line)
+aoview_monitor_parse(const char *input_line)
{
char *saveptr;
char *words[64];
int nword;
+ char line_buf[8192], *line;
+ /* avoid smashing our input parameter */
+ strncpy (line_buf, input_line, sizeof (line_buf)-1);
+ line_buf[sizeof(line_buf) - 1] = '\0';
+ line = line_buf;
for (nword = 0; nword < 64; nword++) {
words[nword] = strtok_r(line, " \t\n", &saveptr);
line = NULL;
return TRUE;
}
+void
+aoview_monitor_reset(void)
+{
+ memset(&state, '\0', sizeof (state));
+}
+
static void
aoview_monitor_callback(gpointer user_data,
struct aoview_serial *serial,
monitor_serial = aoview_serial_open(tty);
if (!monitor_serial)
return FALSE;
+ aoview_table_clear();
+ aoview_monitor_reset();
aoview_serial_set_callback(monitor_serial,
aoview_monitor_callback,
monitor_serial,