* sltermin.c (): Avoid strncpy, home_ti is 1K long and
nobody really needs it whole cleared
Этот коммит содержится в:
родитель
7c9f703060
Коммит
ef67afe62d
@ -1,3 +1,8 @@
|
||||
2004-09-04 Pavel S. Shirshov <pavelsh@mail.ru>
|
||||
|
||||
* sltermin.c (): Avoid strncpy, home_ti is 1K long and
|
||||
nobody really needs it whole cleared
|
||||
|
||||
2004-08-31 Pavel S. Shirshov <pavelsh@mail.ru>
|
||||
|
||||
* include/slang.h: Revert last changes - it breaks compiling
|
||||
|
@ -267,9 +267,12 @@ SLterminfo_Type *_SLtt_tigetent (char *term)
|
||||
|
||||
if (NULL != (home = getenv ("HOME")))
|
||||
{
|
||||
strncpy (home_ti, home, sizeof (home_ti) - 11);
|
||||
home_ti [sizeof(home_ti) - 11] = 0;
|
||||
strcat (home_ti, "/.terminfo");
|
||||
size_t len = strlen (home);
|
||||
|
||||
if (len > sizeof (home_ti) - sizeof ("/.terminfo"))
|
||||
len = sizeof (home_ti) - sizeof ("/.terminfo");
|
||||
memcpy (home_ti, home, len);
|
||||
memcpy (home_ti + len, "/.terminfo", sizeof ("/.terminfo"));
|
||||
Terminfo_Dirs [0] = home_ti;
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user