aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stendahl <jakobste@uio.no>2021-01-12 00:52:03 +0100
committerJakob Stendahl <jakobste@uio.no>2021-01-12 00:52:03 +0100
commit2b4c0824cc4ba3912bcf05db9fbfd6fa6738f602 (patch)
treecc2095500ed09aea416d61dd794b03e3186debe7
parent542f611de1a727133d0c97b475961a7c3159e6bf (diff)
downloadhoverbit-ble-2b4c0824cc4ba3912bcf05db9fbfd6fa6738f602.tar.gz
hoverbit-ble-2b4c0824cc4ba3912bcf05db9fbfd6fa6738f602.zip
:bug: Improve endofmessage-checking
-rw-r--r--source/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/main.cpp b/source/main.cpp
index dde5175..5ba9eb5 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -58,7 +58,7 @@ void onConnected(MicroBitEvent) {
int startI = 1;
for (int i = 1; i < length; i++) {
cChar = command[i];
- if (cChar == 'R' || cChar == 'T' || cChar == 'A' || cChar == 'S' || cChar == ':') {
+ if (cChar == 'R' || cChar == 'T' || cChar == 'A' || cChar == 'S' || i >= length-1) {
int valLength = i - startI;
char val[valLength];
for (int o = 0; o < valLength; o++) {