1
0
mirror of https://github.com/2martens/uni.git synced 2026-05-06 11:26:25 +02:00

[ES] Fixed potential error with loop

Signed-óff-by: Jim Martens <github@2martens.de>
This commit is contained in:
2015-06-03 19:07:46 +02:00
parent e28e272926
commit 353c6d940d

View File

@ -90,8 +90,10 @@ void loop() {
while (readable) { while (readable) {
currentChar = Serial.read(); currentChar = Serial.read();
readable = (currentChar != -1); readable = (currentChar != -1);
command[i] = currentChar; if (readable) {
i++; command[i] = currentChar;
i++;
}
} }
command[i] = '\0'; command[i] = '\0';