]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix eval order of arguments...
authorRyan Norton <wxprojects@comcast.net>
Wed, 9 Feb 2005 17:40:10 +0000 (17:40 +0000)
committerRyan Norton <wxprojects@comcast.net>
Wed, 9 Feb 2005 17:40:10 +0000 (17:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/string.cpp

index 4d16458ff8dfc0cce4a77a088e1c48cbaca819cd..b9e30160aa606bdb8ac09986cc96d61489c8b57e 100644 (file)
@@ -481,8 +481,14 @@ size_t wxStringBase::find(const wxStringBase& str, size_t nStart) const
   while(p - c_str() + str.length() <= length() &&
         wxTmemcmp(p, str.c_str(), str.length()) )
   {
+      //Previosly passed as the first argument to wxTmemchr,
+      //but C/C++ standard does not specify evaluation order
+      //of arguments to functions -
+      //http://embedded.com/showArticle.jhtml?articleID=9900607
+      ++p;
+
       //anchor again
-      p = (const wxChar*)wxTmemchr(++p,
+      p = (const wxChar*)wxTmemchr(p,
                                   str.c_str()[0],
                                   length() - (p - c_str()));