From cde668dada2e32a0a56978eb2e23d5b8d0b4aea6 Mon Sep 17 00:00:00 2001 From: lbernstone Date: Wed, 27 Jun 2018 00:06:02 -0700 Subject: [PATCH] ArduinoOTA endless loop (#1533) * Changed pinmap to show pins34-39 as GPI * ArduinoOTA could have endless loop b/c udp.read can return negative result --- libraries/ArduinoOTA/src/ArduinoOTA.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/ArduinoOTA/src/ArduinoOTA.cpp b/libraries/ArduinoOTA/src/ArduinoOTA.cpp index 2d99808b..1e100991 100644 --- a/libraries/ArduinoOTA/src/ArduinoOTA.cpp +++ b/libraries/ArduinoOTA/src/ArduinoOTA.cpp @@ -149,13 +149,13 @@ int ArduinoOTAClass::parseInt(){ String ArduinoOTAClass::readStringUntil(char end){ String res = ""; - char value; + int value; while(true){ value = _udp_ota.read(); - if(value == '\0' || value == end){ + if(value <= 0 || value == end){ return res; } - res += value; + res += (char)value; } return res; }