openbsd-ports/editors/scintilla/patches/patch-src_AutoComplete_cxx
sturm a8ed68f4f2 Initial import of scintilla 1.54
Scintilla is a free source code editing component. As well as features
found in standard text editing components, Scintilla includes features
especially useful when editing and debugging source code. These include
support for syntax styling, error indicators, code completion and call
tips. The selection margin can contain markers like those used in debuggers
to indicate breakpoints and the current line. Styling choices are more open
than with many editors, allowing the use of proportional fonts, bold and
italics, multiple foreground and background colours and multiple fonts.

WWW: http://www.scintilla.org/

from Joerg Sonnenberger <joerg@bec.de> with patches from Andrew Dalgleisch
2003-08-14 18:24:30 +00:00

37 lines
1.2 KiB
Plaintext

$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;