multimeter plugin: Initizliaze "struct termios".
authorFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 22:37:16 +0000 (23:37 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 22:37:16 +0000 (23:37 +0100)
CID: 38036

src/multimeter.c

index 03608e6..6953750 100644 (file)
@@ -161,9 +161,10 @@ static int multimeter_init (void)
                        int rts = TIOCM_RTS;
                        double value;
 
+                       memset (&tios, 0, sizeof (tios));
                        tios.c_cflag = B1200 | CS7 | CSTOPB | CREAD | CLOCAL;
                        tios.c_iflag = IGNBRK | IGNPAR;
-                       tios.c_oflag = 0;
+                       tios.c_oflag = 0;
                        tios.c_lflag = 0;
                        tios.c_cc[VTIME] = 3;
                        tios.c_cc[VMIN]  = LINE_LENGTH;