- wxASSERT( (nField > 0) && (nField < m_nFields) );
-
- wxString str;
- StatusBar_GetText(hwnd, nField,
- str.GetWriteBuf(StatusBar_GetTextLen(hwnd, nField)));
+ wxASSERT( (nField > -1) && (nField < m_nFields) );
+
+ wxString str("");
+ int len = StatusBar_GetTextLen(hwnd, nField);
+ if (len > 0)
+ {
+ StatusBar_GetText(hwnd, nField, str.GetWriteBuf(len));
+ str.UngetWriteBuf();
+ }