diff options
Diffstat (limited to 'misc/mc/files/patch-slang-sltermin.c')
-rw-r--r-- | misc/mc/files/patch-slang-sltermin.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/misc/mc/files/patch-slang-sltermin.c b/misc/mc/files/patch-slang-sltermin.c new file mode 100644 index 000000000000..73b194aea903 --- /dev/null +++ b/misc/mc/files/patch-slang-sltermin.c @@ -0,0 +1,18 @@ +--- slang/sltermin.c.orig Mon Oct 7 18:08:16 2002 ++++ slang/sltermin.c Tue Jun 15 03:15:09 2004 +@@ -267,9 +267,12 @@ + + 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; + } + |