diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-04-03 14:29:34 +0000 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-04-03 18:43:25 +0200 |
commit | 4ede1862dc62f4cac030a171099d8ec8a9b079ab (patch) | |
tree | c8905f303a00962b5ac395e4338613766906ef61 | |
parent | 42ba1c51d9e843135772a3b9e5cf036a37b28bdb (diff) | |
download | ffmpeg-4ede1862dc62f4cac030a171099d8ec8a9b079ab.tar.gz |
log: Do not assume the TERM variable is always set
-rw-r--r-- | libavutil/log.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/log.c b/libavutil/log.c index 6522ef3607..af86eff70b 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -74,7 +74,7 @@ static void check_color_terminal(void) char *term = getenv("TERM"); use_color = !getenv("NO_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR") && (getenv("TERM") && isatty(2) || getenv("AV_LOG_FORCE_COLOR")); - use_color += !!strstr(term, "256color") ; + use_color += term && strstr(term, "256color"); #else use_color = getenv("AV_LOG_FORCE_COLOR") && !getenv("NO_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR"); |