openbsd-ports/x11/wxWidgets/patches/patch-contrib_src_stc_PlatWX_cpp
todd b25888b419 wxWidgets 2.4.2, C++ cross-platform GUI toolkit
www: http://www.wxwidgets.org/

from Andrew Dalgleish   < openbsd at ajd dot net dot au >
many thanks for much persistence!
2004-07-16 21:01:35 +00:00

41 lines
1.4 KiB
Plaintext

$OpenBSD: patch-contrib_src_stc_PlatWX_cpp,v 1.1.1.1 2004/07/16 21:01:35 todd Exp $
--- contrib/src/stc/PlatWX.cpp.orig 2003-09-20 20:23:20.000000000 +1000
+++ contrib/src/stc/PlatWX.cpp 2003-10-04 13:24:11.000000000 +1000
@@ -982,8 +982,7 @@ void ListBoxImpl::GetValue(int n, char *
item.SetColumn(1);
item.SetMask(wxLIST_MASK_TEXT);
GETLB(id)->GetItem(item);
- strncpy(value, wx2stc(item.GetText()), len);
- value[len-1] = '\0';
+ strlcpy(value, wx2stc(item.GetText()), len);
}
void ListBoxImpl::Sort() {
@@ -1085,7 +1084,7 @@ ColourDesired Platform::ChromeHighlight(
const char *Platform::DefaultFont() {
static char buf[128];
- strcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str());
+ strlcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str(), sizeof(buf));
return buf;
}
@@ -1167,7 +1166,7 @@ bool Platform::ShowAssertionPopUps(bool
void Platform::Assert(const char *c, const char *file, int line) {
char buffer[2000];
- sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
+ snprintf(buffer, sizeof(buffer), "Assertion [%s] failed at %s %d", c, file, line);
if (assertionPopUps) {
/*int idButton = */
wxMessageBox(stc2wx(buffer),
@@ -1181,7 +1180,7 @@ void Platform::Assert(const char *c, con
// abort();
// }
} else {
- strcat(buffer, "\r\n");
+ strlcat(buffer, "\r\n", sizeof(buffer));
Platform::DebugDisplay(buffer);
abort();
}