]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/control.cpp
no message
[wxWidgets.git] / src / msw / control.cpp
index 22090f64c04280d15d1ba3c66b248b5d668eee09..76c80cad360f9ce630fc5ed18e52ce910b2121dc 100644 (file)
@@ -74,9 +74,12 @@ void wxControl::SetLabel(const wxString& label)
 
 wxString wxControl::GetLabel(void) const
 {
-  wxBuffer[0] = 0;
-  if (GetHWND())
-    GetWindowText((HWND)GetHWND(), wxBuffer, 1000);
+    wxBuffer[0] = 0;
+    if (GetHWND())
+    {
+        int len = GetWindowText((HWND)GetHWND(), wxBuffer, 256);
+        wxBuffer[len] = 0;
+    }
 
   return wxString(wxBuffer);
 }