Some code improvements
This commit is contained in:
parent
d10d6839a2
commit
5260b87ca0
|
@ -1002,10 +1002,10 @@ void FTerm::init()
|
||||||
background_color_erase = false;
|
background_color_erase = false;
|
||||||
x11_button_state = 0x03;
|
x11_button_state = 0x03;
|
||||||
|
|
||||||
char* term_env = getenv(const_cast<char*>("TERM"));
|
|
||||||
if ( term_env )
|
// Use format-string to import the untrusted environment variable
|
||||||
strncpy (termtype, term_env, sizeof(termtype) - 1);
|
snprintf(termtype, sizeof(termtype), "%s", getenv("TERM"));
|
||||||
else
|
if ( strnlen(termtype, sizeof(termtype)-1) == 0 )
|
||||||
strncpy (termtype, const_cast<char*>("vt100"), 6);
|
strncpy (termtype, const_cast<char*>("vt100"), 6);
|
||||||
|
|
||||||
locale_xterm = getenv("XTERM_LOCALE");
|
locale_xterm = getenv("XTERM_LOCALE");
|
||||||
|
|
Loading…
Reference in New Issue