From 46974996c74e9e8f4507eddb258441be5151d7f2 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 4 Oct 2015 00:21:08 +0200 Subject: [PATCH] Some code improvements --- src/fterm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fterm.cpp b/src/fterm.cpp index 13c6ce2f..0a057aaf 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -1004,10 +1004,10 @@ void FTerm::init() background_color_erase = false; x11_button_state = 0x03; - // Import untrusted environment variable TERM + // Import the untrusted environment variable TERM const char* term_env = getenv(const_cast("TERM")); if ( term_env ) - strncpy (termtype, term_env, strlen(term_env)); + strncpy (termtype, term_env, sizeof(termtype) - 1); else strncpy (termtype, const_cast("vt100"), 6);