[ expat-Bugs-1023646 ] Error in codepageMap, codepage.c

"SourceForge.net" <[email protected]>
Newsgroups gmane.text.xml.expat.bugs
Message-ID <[email protected]>
Bugs item #1023646, was opened at 2004-09-07 05:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in codepageMap, codepage.c

Initial Comment:
Applies to expat v.1.95.8

>From MS:

"LeadByte:
Specifies a fixed-length array of lead-byte ranges, 
where the number of lead-byte ranges is variable. If 
there are no lead bytes in this code page, then every 
element of the array is NULL. If there are lead bytes in 
this code page, a starting value and ending value is 
specified for each range. Ranges are inclusive. The 
maximum number of lead-byte ranges for any code page 
is five. The array uses two bytes to describe each 
range, with a double-byte null terminator after the last 
range."

Note that "Ranges are inclusive". Therefore the function 
codepageMap should be changed:

for (i = 0; i < MAX_LEADBYTES; i+=2) 
{
  int j, lim;
  if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) 
    break;
  lim = info.LeadByte[i + 1];
  for (j = info.LeadByte[i]; j <= lim; j++) map[j] = -2;
}

Regards,
Ole Stauning, [email protected]


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.