wxOSX: don't call strlen() on possibly null pointer.

Use wxCharBuffer::length() instead, this is more efficient and safer as it
correctly returns 0 in case the conversion fails.

Closes #9967.
This commit is contained in:
Vadim Zeitlin
2015-05-29 16:35:44 +02:00
parent b3b8d8c4a8
commit 0eb1658ca7

View File

@@ -274,7 +274,7 @@ CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush )
void wxMacStringToPascal( const wxString&from , unsigned char * to )
{
wxCharBuffer buf = from.mb_str( wxConvLocal );
int len = strlen(buf);
size_t len = buf.length();
if ( len > 255 )
len = 255;