]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed bug in parsing html strings longer than 1024 chars than does not contain tags
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 7 Sep 2000 20:55:06 +0000 (20:55 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 7 Sep 2000 20:55:06 +0000 (20:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlpars.cpp

index 7986e9610158d48497e4686b44ee6794d28212ef..213bd0f75b7734fab090f11f11d609ee2ec4c652 100644 (file)
@@ -69,11 +69,11 @@ void wxHtmlParser::DoneParser()
 
 
 
-#define wxHTML_MAX_BUFLEN 1024
 
 void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
 {
-    char temp[wxHTML_BUFLEN], c;
+    char c;
+    char *temp = new char[end_pos - begin_pos + 1];
     int i;
     int templen;
 
@@ -86,11 +86,6 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
         // continue building word:
         if (c != '<') {
             temp[templen++] = c;
-            if (templen == wxHTML_BUFLEN-1) {
-                temp[templen] = 0;
-                AddText(temp);
-                templen = 0;
-            }
             i++;
         }
 
@@ -112,6 +107,7 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
         temp[templen] = 0;
         AddText(temp);
     }
+    delete[] temp;
 }