From 6e5fb2ac4e5b780c74f310446ddd80d571170b0d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 12 Oct 2025 14:19:59 -0400 Subject: More code cleanups --- src/stdlib/stdlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/stdlib/stdlib.c') 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)); -- cgit v1.2.3