diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2003-04-05 12:57:51 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2003-04-05 12:57:51 +0000 |
commit | 5e1d5d6c004891aa75c8686673f6a093506c23e5 (patch) | |
tree | 31f898dd69c3edbdfe9a17bd6bed6ba5581ec3c3 /lib/libcurses++/cursslk.cc | |
parent | 9755d4486de16300a95b077637379f172e7b7dab (diff) |
strlcpy
Diffstat (limited to 'lib/libcurses++/cursslk.cc')
-rw-r--r-- | lib/libcurses++/cursslk.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libcurses++/cursslk.cc b/lib/libcurses++/cursslk.cc index 37037514664..fec0d5d2001 100644 --- a/lib/libcurses++/cursslk.cc +++ b/lib/libcurses++/cursslk.cc @@ -40,8 +40,9 @@ MODULE_ID("$From: cursslk.cc,v 1.7 2000/12/09 23:46:12 tom Exp $") void Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) { delete[] label; - label = new char[1 + ::strlen(text)]; - (strcpy)(label,text); + size_t k = 1 + ::strlen(text); + label = new char[k]; + (::strlcpy)(label, text, k); } long Soft_Label_Key_Set::count = 0L; |