From da209561e36aa722f7fda1a036219882b7e90ec6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 9 Sep 2010 22:20:12 +0000 Subject: [PATCH] Fix infinite loop in wxDateTime::Format() when fields width was used. 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 7095fde856..64bb825190 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -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; } -- 2.45.2