File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,10 @@ void ArduinoOTAClass::begin() {
143
143
144
144
int ArduinoOTAClass::parseInt (){
145
145
char data[16 ];
146
- uint8_t index = 0 ;
146
+ uint8_t index ;
147
147
char value;
148
148
while (_udp_ota->peek () == ' ' ) _udp_ota->read ();
149
- while ( true ){
149
+ for ( index = 0 ; index < sizeof (data); ++ index ){
150
150
value = _udp_ota->peek ();
151
151
if (value < ' 0' || value > ' 9' ){
152
152
data[index ++] = ' \0 ' ;
@@ -159,13 +159,13 @@ int ArduinoOTAClass::parseInt(){
159
159
160
160
String ArduinoOTAClass::readStringUntil (char end){
161
161
String res = " " ;
162
- char value;
162
+ int value;
163
163
while (true ){
164
164
value = _udp_ota->read ();
165
- if (value == ' \0 ' || value == end){
165
+ if (value < 0 || value == ' \0 ' || value == end){
166
166
return res;
167
167
}
168
- res += value;
168
+ res += static_cast < char >( value) ;
169
169
}
170
170
return res;
171
171
}
You can’t perform that action at this time.
0 commit comments