]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix infinite loop in wxDateTime::Format() when fields width was used.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 9 Sep 2010 22:20:12 +0000 (22:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 9 Sep 2010 22:20:12 +0000 (22:20 +0000)
Just add a missing increment of the loop variable.

See #12451.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datetimefmt.cpp

index 7095fde8566ecbca67635ab2706f27d18ee5636f..64bb825190c80beed847ce48e06e2d7fdcd8b41e 100644 (file)
@@ -648,9 +648,10 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
 
                 default:
                     // is it the format width?
-                    fmt.Empty();
-                    while ( *p == wxT('-') || *p == wxT('+') ||
-                            *p == wxT(' ') || wxIsdigit(*p) )
+                    for ( fmt.clear();
+                          *p == wxT('-') || *p == wxT('+') ||
+                            *p == wxT(' ') || wxIsdigit(*p);
+                          ++p )
                     {
                         fmt += *p;
                     }