]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
add safe wxStrlcpy() function and replaced all wxStrncpy() calls by it
[wxWidgets.git] / src / msw / listctrl.cpp
index 63c158daeb139caad10b4a8768c059f5f4d0acec..504899d2ee5aef071db9caaf1f9e9e158a2c317f 100644 (file)
@@ -2485,8 +2485,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                     if ( lvi.mask & LVIF_TEXT )
                     {
                         wxString text = OnGetItemText(item, lvi.iSubItem);
-                        wxStrncpy(lvi.pszText, text, lvi.cchTextMax - 1);
-                        lvi.pszText[lvi.cchTextMax - 1] = _T('\0');
+                        wxStrlcpy(lvi.pszText, text, lvi.cchTextMax);
                     }
 
                     // see comment at the end of wxListCtrl::GetColumn()