Skip to content

Commit cde668d

Browse files
lbernstoneme-no-dev
authored andcommitted
ArduinoOTA endless loop (espressif#1533)
* Changed pinmap to show pins34-39 as GPI * ArduinoOTA could have endless loop b/c udp.read can return negative result
1 parent a59eafb commit cde668d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/ArduinoOTA/src/ArduinoOTA.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ int ArduinoOTAClass::parseInt(){
149149

150150
String ArduinoOTAClass::readStringUntil(char end){
151151
String res = "";
152-
char value;
152+
int value;
153153
while(true){
154154
value = _udp_ota.read();
155-
if(value == '\0' || value == end){
155+
if(value <= 0 || value == end){
156156
return res;
157157
}
158-
res += value;
158+
res += (char)value;
159159
}
160160
return res;
161161
}

0 commit comments

Comments
 (0)