-#if wxUSE_WCHAR_T
- if (m_type == wxPAT_PWCHAR)
- {
- // user passed a string explicitely indicated as Unicode...
- val = s = wxString(p->pad_pwchar, wxConvLibc);
-
- //printf("converting Unicode=>ANSI"); // for debug
- }
-#endif
-#endif
- int len;
-
- if (val)
- {
-#if wxUSE_STRUTILS
- // at this point we are sure that m_nMaxWidth is positive or null
- // (see top of wxPrintfConvSpec::LoadArg)
- len = wxMin((unsigned int)m_nMaxWidth, wxStrlen(val));
-#else
- for ( len = 0; val[len] && (len < m_nMaxWidth); len++ )
- ;
-#endif
- }
- else if (m_nMaxWidth >= 6)
- {
- val = wxT("(null)");
- len = 6;
- }
- else
- {
- val = wxEmptyString;
- len = 0;
- }
+ // at this point we are sure that m_nMaxWidth is positive or
+ // null (see top of wxPrintfConvSpec::LoadArg)
+ int len = wxMin((unsigned int)m_nMaxWidth, s.length());