Page 1 of 1

Bug in XLSHTMLParse5.DecodeQuotedPrintable

Posted: Tue Oct 22, 2013 6:29 am
by Midiar
The code in the for loop stretches beyond the length of the string:

Code: Select all

  for i := 1 to Length(Result) - 1 do begin
    if (Result[i] = '&') and (Result[i + 1] = '#') and ((Length(Result) - i) >= 3) then begin
I changed it to the following, and got rid of an error that occurred when importing mhtml xls files that were output from SAP. Or the best thing may be to shorten the for loop.

Code: Select all

  for i := 1 to Length(Result) - 1 do begin
    if ((Length(Result) - i) >= 3) and (Result[i] = '&') and (Result[i + 1] = '#') then begin
The rest of the code in the loop should be safe, as Copy adjusts itself happily to wrong indexes.
I'm using version 5.20.05.

Re: Bug in XLSHTMLParse5.DecodeQuotedPrintable

Posted: Tue Oct 22, 2013 1:59 pm
by larsa
Hello

Thank you. Your fix will be included inthe next update.