Some code improvements

This commit is contained in:
Markus Gans 2015-10-03 19:41:59 +02:00
parent 5842a74a19
commit c00e3e3d80
1 changed files with 5 additions and 4 deletions

View File

@ -1001,10 +1001,11 @@ void FTerm::init()
background_color_erase = false; background_color_erase = false;
x11_button_state = 0x03; x11_button_state = 0x03;
char const* term_env = getenv("TERM"); // Import untrusted environment variable TERM
if ( term_env ) // Import untrusted environment variable TERM const char* term_env = getenv("TERM");
snprintf(termtype, sizeof(termtype), "%s", getenv("TERM")); if ( term_env )
snprintf(termtype, sizeof(termtype), "%s", term_env);
else else
strncpy (termtype, const_cast<char*>("vt100"), 6); strncpy (termtype, const_cast<char*>("vt100"), 6);