diff options
Diffstat (limited to 'src/stdlib/stdlib.c')
| -rw-r--r-- | src/stdlib/stdlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdlib/stdlib.c b/src/stdlib/stdlib.c index 5204194b..dd6f804d 100644 --- a/src/stdlib/stdlib.c +++ b/src/stdlib/stdlib.c @@ -61,7 +61,8 @@ void tomo_init(void) { GC_INIT(); const char *color_env = getenv("COLOR"); USE_COLOR = color_env ? strcmp(color_env, "1") == 0 : isatty(STDOUT_FILENO); - if (getenv("NO_COLOR") && getenv("NO_COLOR")[0] != '\0') USE_COLOR = false; + const char *no_color_env = getenv("NO_COLOR"); + if (no_color_env && no_color_env[0] != '\0') USE_COLOR = false; setlocale(LC_ALL, ""); assert(getrandom(TOMO_HASH_KEY, sizeof(TOMO_HASH_KEY), 0) == sizeof(TOMO_HASH_KEY)); |
