aboutsummaryrefslogtreecommitdiff
path: root/src/tomo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-12 14:05:22 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-12 14:05:22 -0400
commit3cd3b20f58e9d2c6463d503be09e5d4cfaadee6c (patch)
tree9b7120a4969a38793ecff3aab549b463c7dcf822 /src/tomo.c
parentbd190ac0a84eefa3174c04ce1fe2059aed6f2d1b (diff)
Code cleanup and fixing minor issues
Diffstat (limited to 'src/tomo.c')
-rw-r--r--src/tomo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tomo.c b/src/tomo.c
index 0bddb426..46076ba2 100644
--- a/src/tomo.c
+++ b/src/tomo.c
@@ -136,8 +136,10 @@ int main(int argc, char *argv[]) {
ldlibs = Texts(ldlibs, Text(" -lexecinfo"));
#endif
- USE_COLOR = getenv("COLOR") ? strcmp(getenv("COLOR"), "1") == 0 : isatty(STDOUT_FILENO);
- if (getenv("NO_COLOR") && getenv("NO_COLOR")[0] != '\0') USE_COLOR = false;
+ const char *color_env = getenv("COLOR");
+ USE_COLOR = color_env ? strcmp(color_env, "1") == 0 : isatty(STDOUT_FILENO);
+ const char *no_color_env = getenv("NO_COLOR");
+ if (no_color_env && no_color_env[0] != '\0') USE_COLOR = false;
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
arc4random_buf(TOMO_HASH_KEY, sizeof(TOMO_HASH_KEY));