X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..523050b607cfb5e6f9dfcb1544eb4f49ec1978cd:/src/html/htmlpars.cpp

diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp
index 7986e96101..65066aeddc 100644
--- a/src/html/htmlpars.cpp
+++ b/src/html/htmlpars.cpp
@@ -69,11 +69,13 @@ void wxHtmlParser::DoneParser()
 
 
 
-#define wxHTML_MAX_BUFLEN 1024
 
 void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
 {
-    char temp[wxHTML_BUFLEN], c;
+    if (end_pos <= begin_pos) return;
+
+    char c;
+    char *temp = new char[end_pos - begin_pos + 1];
     int i;
     int templen;
 
@@ -86,11 +88,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 +109,7 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
         temp[templen] = 0;
         AddText(temp);
     }
+    delete[] temp;
 }