Some minor fixes in URI and http_request demo.

Fixed a crash in UIDropDownList.
Some fixes in all UILayouts.
This commit is contained in:
Martín Lucas Golini
2020-05-10 01:00:50 -03:00
parent d2a90dfb28
commit 9b7ab4e891
13 changed files with 64 additions and 22 deletions

View File

@@ -150,7 +150,8 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
totalBytes != currentBytes )
return true;
tickElapsed.restart();
double progress = currentBytes / static_cast<double>( totalBytes );
double progress =
totalBytes > 0 ? currentBytes / static_cast<double>( totalBytes ) : 0;
Time eta( elapsed.getElapsedTime() / progress - elapsed.getElapsedTime() );
int percent = static_cast<int>( eefloor( progress * 100. ) );
std::string bytesProgress( String::format(
@@ -194,7 +195,7 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
httpProxy = proxy.Get();
}
if ( httpProxy.find( "://" ) == std::string::npos ) {
if ( !httpProxy.empty() && httpProxy.find( "://" ) == std::string::npos ) {
httpProxy = "http://" + httpProxy;
}