|
58 | 58 | # define DRIVER_NAME "Generic Q* Serial driver" |
59 | 59 | #endif /* QX_USB */ |
60 | 60 |
|
61 | | -#define DRIVER_VERSION "0.51" |
| 61 | +#define DRIVER_VERSION "0.52" |
62 | 62 |
|
63 | 63 | #ifdef QX_SERIAL |
64 | 64 | # include "serial.h" |
@@ -923,6 +923,8 @@ static int phoenix_command(const char *cmd, size_t cmdlen, char *buf, size_t buf |
923 | 923 | for (i = 0; i < 8; i++) { |
924 | 924 |
|
925 | 925 | /* Read data in 8-byte chunks */ |
| 926 | + memset(tmp, 0, sizeof(tmp)); |
| 927 | + |
926 | 928 | /* ret = usb->get_interrupt(udev, (unsigned char *)tmp, 8, 1000); */ |
927 | 929 | ret = usb_interrupt_read(udev, |
928 | 930 | 0x81, |
@@ -1640,6 +1642,7 @@ static int fuji_command(const char *cmd, size_t cmdlen, char *buf, size_t buflen |
1640 | 1642 | /* Send command */ |
1641 | 1643 |
|
1642 | 1644 | /* Remove the CR */ |
| 1645 | + memset(command, 0, sizeof(command)); |
1643 | 1646 | snprintf(command, sizeof(command), "%.*s", (int)strcspn(cmd, "\r"), cmd); |
1644 | 1647 |
|
1645 | 1648 | /* Length of the command that will be sent to the UPS can be |
@@ -1947,6 +1950,8 @@ static int ablerex_command(const char *cmd, size_t cmdlen, char *buf, size_t buf |
1947 | 1950 | int ret; |
1948 | 1951 |
|
1949 | 1952 | memset(buf, 0, buflen); |
| 1953 | + memset(tmp, 0, sizeof(tmp)); |
| 1954 | + |
1950 | 1955 | tmp[0] = 0x05; |
1951 | 1956 | tmp[1] = 0; |
1952 | 1957 | tmp[2] = 1 + (char)strcspn(cmd, "\r"); |
|
0 commit comments