X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4a980f4f57a4e7eea00c55cbb3d139f97d90c20..afd83fb797653f08df03653c177807390d154cf8:/src/common/textbuf.cpp

diff --git a/src/common/textbuf.cpp b/src/common/textbuf.cpp
index 8c7253e8b6..b6e8362c85 100644
--- a/src/common/textbuf.cpp
+++ b/src/common/textbuf.cpp
@@ -80,14 +80,14 @@ wxString wxTextBuffer::Translate(const wxString& text, wxTextFileType type)
     wxString eol = GetEOL(type), result;
 
     // optimization: we know that the length of the new string will be about
-    // the same as the length of the old one, so prealloc memory to aviod
+    // the same as the length of the old one, so prealloc memory to avoid
     // unnecessary relocations
     result.Alloc(text.Len());
 
     wxChar chLast = 0;
-    for ( const wxChar *pc = text.c_str(); *pc; pc++ )
+    for ( wxString::const_iterator i = text.begin(); i != text.end(); ++i )
     {
-        wxChar ch = *pc;
+        wxChar ch = *i;
         switch ( ch ) {
             case _T('\n'):
                 // Dos/Unix line termination
@@ -226,7 +226,7 @@ wxTextFileType wxTextBuffer::GuessType() const
             case wxTextFileType_Unix: nUnix++; break;   \
             case wxTextFileType_Dos:  nDos++;  break;   \
             case wxTextFileType_Mac:  nMac++;  break;   \
-            default: wxFAIL_MSG(_("unknown line terminator")); \
+            default: wxFAIL_MSG(_T("unknown line terminator")); \
         }
 
     size_t n;