fixed bug in SQL access where timeout was compared to a negative value

This commit is contained in:
csoler 2020-03-05 20:51:02 +01:00
parent 09fe628415
commit f59193b625
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -185,7 +185,7 @@ bool RetroDb::execSQL(const std::string &query){
uint32_t delta = 3;
rstime_t stamp = time(NULL), now = 0;
rstime_t stamp = time(NULL);
bool timeOut = false, ok = false;
while(!timeOut){
@ -202,10 +202,8 @@ bool RetroDb::execSQL(const std::string &query){
break;
}
now = time(NULL);
delta = stamp - now;
if(delta > TIME_LIMIT){
if(time(NULL) > stamp + TIME_LIMIT)
{
ok = false;
timeOut = true;
}