2007-01-18 05:56:27 -05:00
|
|
|
$OpenBSD: patch-src_ExternalLexer_cxx,v 1.2 2007/01/18 10:56:27 steven Exp $
|
|
|
|
--- src/ExternalLexer.cxx.orig Tue Mar 28 17:31:51 2006
|
|
|
|
+++ src/ExternalLexer.cxx Tue Mar 28 17:31:51 2006
|
|
|
|
@@ -42,8 +42,9 @@ char **WordListsToStrings(WordList *val[
|
2003-08-14 14:24:30 -04:00
|
|
|
if (n != val[i]->len - 1)
|
|
|
|
words += " ";
|
|
|
|
}
|
|
|
|
- wls[i] = new char[words.length() + 1];
|
|
|
|
- strcpy(wls[i], words.c_str());
|
|
|
|
+ size_t wls_len = words.length() + 1;
|
|
|
|
+ wls[i] = new char[wls_len];
|
|
|
|
+ strlcpy(wls[i], words.c_str(), wls_len);
|
|
|
|
}
|
|
|
|
wls[dim] = 0;
|
|
|
|
return wls;
|
2007-01-18 05:56:27 -05:00
|
|
|
@@ -131,7 +132,7 @@ LexerLibrary::LexerLibrary(const char* M
|
2003-08-14 14:24:30 -04:00
|
|
|
|
|
|
|
// Assign a buffer for the lexer name.
|
|
|
|
char lexname[100];
|
|
|
|
- strcpy(lexname, "");
|
|
|
|
+ lexname[0] = 0;
|
|
|
|
|
|
|
|
int nl = GetLexerCount();
|
|
|
|
|