From 00e63fcc18cc62eed600c46205e64625d0e6304c Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 11 May 2020 00:02:01 +0100 Subject: [PATCH] small cosmetic fix --- serial_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serial_windows.go b/serial_windows.go index e2c40f5..ec328f9 100644 --- a/serial_windows.go +++ b/serial_windows.go @@ -75,7 +75,6 @@ func (port *windowsPort) Close() error { func (port *windowsPort) Read(p []byte) (int, error) { var readed uint32 - params := &dcb{} ev, err := createOverlappedEvent() if err != nil { return 0, err @@ -107,6 +106,7 @@ func (port *windowsPort) Read(p []byte) (int, error) { // a serial port is alive in Windows is to check if the SetCommState // function fails. + params := &dcb{} getCommState(port.handle, params) if err := setCommState(port.handle, params); err != nil { port.Close()