File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,10 @@ void ArduinoOTAClass::begin() {
143143
144144int ArduinoOTAClass::parseInt (){
145145 char data[16 ];
146- uint8_t index = 0 ;
146+ uint8_t index;
147147 char value;
148148 while (_udp_ota->peek () == ' ' ) _udp_ota->read ();
149- while ( true ){
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
160160String 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 == 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}
You can’t perform that action at this time.
0 commit comments