1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Interpret negative arguments to sqlite3_sleep() as zero.

FossilOrigin-Name: 2b542326aa8e7e1f6ed9d999b95ae5340278e0821277a17de3cc803b4af793ae
This commit is contained in:
drh
2023-05-02 16:34:15 +00:00
parent 8c79ea8447
commit d6b3a02d21
5 changed files with 20 additions and 10 deletions

View File

@@ -3933,7 +3933,7 @@ int sqlite3_sleep(int ms){
/* This function works in milliseconds, but the underlying OsSleep()
** API uses microseconds. Hence the 1000's.
*/
rc = (sqlite3OsSleep(pVfs, 1000*ms)/1000);
rc = (sqlite3OsSleep(pVfs, ms<0 ? 0 : 1000*ms)/1000);
return rc;
}