aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKing Kévin <kingkevin@cuvoodoo.info>2020-01-09 11:31:11 +0100
committerKing Kévin <kingkevin@cuvoodoo.info>2020-01-09 11:31:11 +0100
commita52d5ed06947d1bfb2a70e39f7b9ad2c3ebee1a2 (patch)
tree35b37ff1e149e4d70cffb365a818c76e66f9b923
parent2e9cf7068872bcd73f6f7cc60e5d5651a6fe5cf8 (diff)
fix line buffer size
-rw-r--r--u2_bt.c2
-rw-r--r--u2_usb.c2
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