Fixed reading "TRUE" or "true" in cache env variable

This commit is contained in:
TheDarkBug 2021-10-14 22:39:29 +02:00 committed by GitHub
parent 8147b0a528
commit debc5a7c05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,7 @@ int main(int argc, char *argv[])
int cache_enabled = 0; int cache_enabled = 0;
char buffer[128]; char buffer[128];
sscanf(cache_env, "%1[TRUEtrue1]", buffer); sscanf(cache_env, "%4[TRUEtrue1]", buffer);
cache_enabled = (strcmp(buffer, "true") == 0 || strcmp(buffer, "TRUE") == 0 || strcmp(buffer, "1") == 0); cache_enabled = (strcmp(buffer, "true") == 0 || strcmp(buffer, "TRUE") == 0 || strcmp(buffer, "1") == 0);
if (cache_enabled) if (cache_enabled)
{ {