Module Name: src Committed By: martin Date: Sun May 31 10:41:40 UTC 2020
Modified Files: src/lib/libterminfo [netbsd-9]: curterm.c Log Message: Pull up following revision(s) (requested by roy in ticket #936): lib/libterminfo/curterm.c: revision 1.14 terminfo: test strlcpy result against space free, not string length riastradh@ yep, looks good. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.13.12.1 src/lib/libterminfo/curterm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libterminfo/curterm.c diff -u src/lib/libterminfo/curterm.c:1.13 src/lib/libterminfo/curterm.c:1.13.12.1 --- src/lib/libterminfo/curterm.c:1.13 Thu May 4 09:42:23 2017 +++ src/lib/libterminfo/curterm.c Sun May 31 10:41:39 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: curterm.c,v 1.13 2017/05/04 09:42:23 roy Exp $ */ +/* $NetBSD: curterm.c,v 1.13.12.1 2020/05/31 10:41:39 martin Exp $ */ /* * Copyright (c) 2009, 2011 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: curterm.c,v 1.13 2017/05/04 09:42:23 roy Exp $"); +__RCSID("$NetBSD: curterm.c,v 1.13.12.1 2020/05/31 10:41:39 martin Exp $"); #include <assert.h> #include <stdlib.h> @@ -99,21 +99,21 @@ set_curterm(TERMINAL *nterm) p = ttytype; l = sizeof(ttytype); - if ((n = strlcpy(p, nterm->name, l)) == strlen(p)) { + if ((n = strlcpy(p, nterm->name, l)) < l) { p += n; l -= n; *p++ = '|'; l--; - if (nterm->_alias && - (n = strlcpy(p, nterm->_alias, l)) == strlen(p)) + if (nterm->_alias != NULL && + (n = strlcpy(p, nterm->_alias, l)) < l) { p += n; l -= n; *p++ = '|'; l--; } - if (nterm->desc && - (n = strlcpy(p, nterm->desc, l)) == strlen(p)) + if (nterm->desc != NULL && + (n = strlcpy(p, nterm->desc, l)) < l) { p += n; l -= n;