[wx-dev] [ wxwindows-Bugs-1956966 ] wxHTML HtmlizeLinebreaks bug

SourceForge.net noreply at sourceforge.net
Sat May 3 15:55:43 PDT 2008


Bugs item #1956966, was opened at 2008-05-04 09:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1956966&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: HTML
Group: Trivial
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: HzD_Byte (hzd_byte)
Assigned to: Vaclav Slavik (vaclavslavik)
Summary: wxHTML HtmlizeLinebreaks bug

Initial Comment:
An error in "src/html/m_pre.cpp", HtmlizeLinebreaks:

for ( wxString::const_iterator i = str.begin(); i != str.end(); ++i )
{
        switch ( (*i).GetValue() )
        {
            case '<':
                while ( i != str.end() && *i != '>')
                {
                    out << *i++;
                }
                out << '>';
                break;
 ....
}

If inner "while" ends with "i == str.end()", then "++i" occurs and "i != str.end()" of outer "for" is true. It's incorrect..

Solution:

case '<':
    while ( i != str.end() && *i != '>')
    {
        out << *i++;
    }
    out << '>';
    if (i == str.end()) return out;
    break;

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1956966&group_id=9863


More information about the wx-dev mailing list