Skip to content

Commit c551688

Browse files
authored
Update ArduinoOTA.cpp
1 parent dcf38c9 commit c551688

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/ArduinoOTA/ArduinoOTA.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ int ArduinoOTAClass::parseInt(){
146146
uint8_t index;
147147
char value;
148148
while(_udp_ota->peek() == ' ') _udp_ota->read();
149-
for(index = 0; index < sizeof(data); index++){
149+
for(index = 0; index < sizeof(data); ++index){
150150
value = _udp_ota->peek();
151151
if(value < '0' || value > '9'){
152152
data[index++] = '\0';
@@ -159,13 +159,13 @@ int ArduinoOTAClass::parseInt(){
159159

160160
String ArduinoOTAClass::readStringUntil(char end){
161161
String res = "";
162-
char value;
162+
int value;
163163
while(true){
164164
value = _udp_ota->read();
165-
if(value < '0' || value == '\0' || value == end){
165+
if(value < 0 || value == '\0' || value == end){
166166
return res;
167167
}
168-
res += value;
168+
res += static_cast<char>(value);
169169
}
170170
return res;
171171
}

0 commit comments

Comments
 (0)