From a52d5ed06947d1bfb2a70e39f7b9ad2c3ebee1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Thu, 9 Jan 2020 11:31:11 +0100 Subject: [PATCH] fix line buffer size --- u2_bt.c | 2 +- u2_usb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/u2_bt.c b/u2_bt.c index 8aaf100..befebb9 100644 --- a/u2_bt.c +++ b/u2_bt.c @@ -791,7 +791,7 @@ int main(int argc, char* argv[]) } } // line containing values for influxdb - char line[21 * 4]; + char line[22 * 4]; int line_len; if (packet_len == sizeof(packet)) { // message is complete if (0xf1 == packet[0] && 0x01 == packet[1]) { // device information packet diff --git a/u2_usb.c b/u2_usb.c index fd14a5d..e368051 100644 --- a/u2_usb.c +++ b/u2_usb.c @@ -189,7 +189,7 @@ int main(int argc, char* argv[]) bool run = true; // read from USB as long as true struct u2_measurement_t meas; // to store the parsed measurement values // line containing values for influxdb - char line[21 * 2]; + char line[22 * 2]; int line_len; while (run) { rc = hid_read_timeout(handle, meas.payload, ARRAY_SIZE(meas.payload), 50); // wait for max 50 ms for a measurement