]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
add safe wxStrlcpy() function and replaced all wxStrncpy() calls by it
[wxWidgets.git] / src / msw / app.cpp
index fccf2634094c2ba08d5e1004f5509fcf79960412..b13dd1904e4736e0e1b8dd284b53fb7a9d197d00 100644 (file)
@@ -664,8 +664,8 @@ static void RegisterAndStoreClassName(const wxString& uniqueClassName,
                                       WNDCLASS *lpWndClass)
 {
     const size_t length = uniqueClassName.length() + 1; // for trailing NUL
-    wxChar *newChars = new wxChar[length];
-    wxStrncpy(newChars, uniqueClassName, length);
+    wxChar * const newChars = new wxChar[length];
+    wxStrlcpy(newChars, uniqueClassName, length);
     *className = newChars;
     lpWndClass->lpszClassName = *className;