$OpenBSD: patch-src_AutoComplete_cxx,v 1.1.1.1 2003/08/14 18:24:30 sturm Exp $
--- src/AutoComplete.cxx.orig	2003-08-13 17:04:03.000000000 +1000
+++ src/AutoComplete.cxx	2003-08-13 17:28:29.000000000 +1000
@@ -56,8 +56,7 @@ void AutoComplete::Start(Window &parent,
 }
 
 void AutoComplete::SetStopChars(const char *stopChars_) {
-	strncpy(stopChars, stopChars_, sizeof(stopChars));
-	stopChars[sizeof(stopChars) - 1] = '\0';
+	strlcpy(stopChars, stopChars_, sizeof(stopChars));
 }
 
 bool AutoComplete::IsStopChar(char ch) {
@@ -65,8 +64,7 @@ bool AutoComplete::IsStopChar(char ch) {
 }
 
 void AutoComplete::SetFillUpChars(const char *fillUpChars_) {
-	strncpy(fillUpChars, fillUpChars_, sizeof(fillUpChars));
-	fillUpChars[sizeof(fillUpChars) - 1] = '\0';
+	strlcpy(fillUpChars, fillUpChars_, sizeof(fillUpChars));
 }
 
 bool AutoComplete::IsFillUpChar(char ch) {
@@ -91,9 +89,10 @@ char AutoComplete::GetTypesep() {
 
 void AutoComplete::SetList(const char *list) {
 	lb->Clear();
-	char *words = new char[strlen(list) + 1];
+	size_t words_len = strlen(list) + 1;
+	char *words = new char[words_len];
 	if (words) {
-		strcpy(words, list);
+		strlcpy(words, list, words_len);
 		char *startword = words;
 		char *numword = NULL;
 		int i = 0;
