Code

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 03608e6cfe5e61110e13552f43f7fd8e5963c46c..6953750525ce34cd2f4e50de26af4cfa6f6949e3 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;