sysutils/screen*: Fix off-by-one buffer overflow
FreeBSD ncurses, as of c8b9c85ee5bb, does a strncpy() of 1024 bytes into
a 1023 byte buffer supplied by screen. This section of code in ncurses
was removed in 61f66a1f4403, and is not a problem since 14.0-RELEASE.
But it is still a problem in 13-STABLE.
Thank you to dim@ for detailed analysis and initial patch to
sysutils/screen. The same patch is also applied to sysutils/screen-devel
this commit.
PR: 280868
(cherry picked from commit 1c7e0fd32c4ac92369dbdc15fb5abf048524a9b2)