ports/audio/mpg123/files/patch-ag
Dag-Erling Smørgrav 14839ee02d Take care not to dereference the return value from getenv(3) without first
checking that it's not NULL.

PR:		ports/45252
Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
2003-02-10 11:01:42 +00:00

17 lines
442 B
Text

--- mpg123.c.orig Fri Jun 18 14:18:11 1999
+++ mpg123.c Mon Feb 10 11:58:08 2003
@@ -920,10 +920,10 @@
#if !defined(GENERIC)
{
- const char *term_type;
- term_type = getenv("TERM");
- if (!strcmp(term_type,"xterm"))
- {
+ const char *term_type;
+
+ if (((term_type = getenv("TERM")) != NULL)
+ && (!strcmp(term_type,"xterm"))) {
fprintf(stderr, "\033]0;%s\007", filename);
}
}