Some code improvements
This commit is contained in:
parent
8581b27085
commit
391c772922
|
@ -938,7 +938,8 @@ void FTerm::signal_handler (int signum)
|
||||||
void FTerm::init()
|
void FTerm::init()
|
||||||
{
|
{
|
||||||
char local256[80] = "";
|
char local256[80] = "";
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6, *term_env;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
|
std::string term_env;
|
||||||
|
|
||||||
output_buffer = new std::queue<int>;
|
output_buffer = new std::queue<int>;
|
||||||
vt100_alt_char = new std::map<uChar,uChar>;
|
vt100_alt_char = new std::map<uChar,uChar>;
|
||||||
|
@ -1003,9 +1004,9 @@ void FTerm::init()
|
||||||
x11_button_state = 0x03;
|
x11_button_state = 0x03;
|
||||||
|
|
||||||
// Import untrusted environment variable TERM
|
// Import untrusted environment variable TERM
|
||||||
term_env = getenv("TERM");
|
term_env = std::string(std::getenv("TERM"));
|
||||||
if ( term_env != 0 )
|
if ( ! term_env.empty() )
|
||||||
strncat (termtype, term_env, sizeof(termtype) - strlen(termtype) - 1);
|
strncat (termtype, term_env.c_str(), sizeof(termtype) - strlen(termtype) - 1);
|
||||||
else
|
else
|
||||||
strncpy (termtype, const_cast<char*>("vt100"), 6);
|
strncpy (termtype, const_cast<char*>("vt100"), 6);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue