From dcf38c9bf2fee9775ed9251171b83aad27c847ba Mon Sep 17 00:00:00 2001 From: ZaPpInG Date: Thu, 4 Jan 2018 15:09:00 +0100 Subject: [PATCH 1/2] Update ArduinoOTA.cpp --- libraries/ArduinoOTA/ArduinoOTA.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/ArduinoOTA/ArduinoOTA.cpp b/libraries/ArduinoOTA/ArduinoOTA.cpp index 3c6acd943d..e2d6717615 100644 --- a/libraries/ArduinoOTA/ArduinoOTA.cpp +++ b/libraries/ArduinoOTA/ArduinoOTA.cpp @@ -146,26 +146,26 @@ int ArduinoOTAClass::parseInt(){ uint8_t index; char value; while(_udp_ota->peek() == ' ') _udp_ota->read(); - for(index = 0; index < sizeof(data); ++index){ + for(index = 0; index < sizeof(data); index++){ value = _udp_ota->peek(); if(value < '0' || value > '9'){ data[index++] = '\0'; return atoi(data); } - data[index++] = _udp_ota->read(); + data[index] = _udp_ota->read(); } return 0; } String ArduinoOTAClass::readStringUntil(char end){ String res = ""; - int value; + char value; while(true){ value = _udp_ota->read(); - if(value < 0 || value == '\0' || value == end){ + if(value < '0' || value == '\0' || value == end){ return res; } - res += static_cast(value); + res += value; } return res; } From c5516887e56d62cd0fe5512c3d034fd5b241b046 Mon Sep 17 00:00:00 2001 From: ZaPpInG Date: Thu, 4 Jan 2018 17:53:28 +0100 Subject: [PATCH 2/2] Update ArduinoOTA.cpp --- libraries/ArduinoOTA/ArduinoOTA.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/ArduinoOTA/ArduinoOTA.cpp b/libraries/ArduinoOTA/ArduinoOTA.cpp index e2d6717615..e3f13cfe35 100644 --- a/libraries/ArduinoOTA/ArduinoOTA.cpp +++ b/libraries/ArduinoOTA/ArduinoOTA.cpp @@ -146,7 +146,7 @@ int ArduinoOTAClass::parseInt(){ uint8_t index; char value; while(_udp_ota->peek() == ' ') _udp_ota->read(); - for(index = 0; index < sizeof(data); index++){ + for(index = 0; index < sizeof(data); ++index){ value = _udp_ota->peek(); if(value < '0' || value > '9'){ data[index++] = '\0'; @@ -159,13 +159,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 == '\0' || value == end){ + if(value < 0 || value == '\0' || value == end){ return res; } - res += value; + res += static_cast(value); } return res; }