From: risk it <ris...@ya...> - 2002-11-26 01:05:07
|
Hi Guys, I have had some testings done with the WV code, and I have some bug fixing to suggest: 1. This is for the case where the strange case happens allot, so it can be released proparly. In stylesheet.c (around line 243), in the function wvGetSTD, after the following code: for (i = 0; i < item->cupx; i++) { if ((pos + 1) / 2 != pos / 2) { /*eat odd bytes */ wvStream_offset (fd, 1); pos++; } add the following line: item->grupe[0].chpx.grpprl = NULL; 2. Add a few memory freeing to avoid memory leaks. In decode_simple(line 227) - between the following lines: wvHandleDocument (ps, DOCEND); return; add, before returning: wvReleaseSTTBF (&ps->anSttbfAssoc); wvFree (posChpx); wvFree (bteChpx); wvFree (btePapx); wvReleaseCLX (&ps->clx); wvReleaseSTSH (&ps->stsh); 3. In wvParse.c, in wvInitParser, add the following (as more parameters needs initialization for later use - when it is not done properly): ps->mainfd = NULL; ps->tablefd = NULL; ps->data = NULL; ps->summary = NULL; ps->anSttbfAssoc.extendedflag = 0; ps->anSttbfAssoc.nostrings = 0; ps->anSttbfAssoc.extradatalen = 0; ps->anSttbfAssoc.s8strings = NULL; ps->anSttbfAssoc.u16strings = NULL; ps->anSttbfAssoc.extradata = NULL; ps->Sttbfbkmk.extendedflag = 0; ps->Sttbfbkmk.nostrings = 0; ps->Sttbfbkmk.extradatalen = 0; ps->Sttbfbkmk.s8strings = NULL; ps->Sttbfbkmk.u16strings = NULL; ps->Sttbfbkmk.extradata = NULL; ps->lfo = NULL; ps->lfolvl = NULL; ps->lvl = NULL; ps->nolfo = 0; ps->nooflvl = 0; ps->noofLST = 0; ps->clx.pcd = NULL; ps->clx.pos = NULL; ps->clx.nopcd = 0; ps->clx.grpprl_count = 0; ps->clx.cbGrpprl = NULL; ps->clx.grpprl = NULL; ps->stsh.Stshi.cstd = 0; ps->stsh.Stshi.cbSTDBaseInFile = 0; ps->stsh.Stshi.istdMaxFixedWhenSaved = 0; ps->stsh.Stshi.nVerBuiltInNamesWhenSaved = 0; ps->stsh.std = NULL; ps->finallvl = NULL; ps->liststartnos = NULL; ps->listnfcs = NULL; ps->tablefd0 = NULL; ps->tablefd1 = NULL; ps->currentcp = 0; ps->nextpap.istd = 0; ps->nextpap.jc = 0; ps->nextpap.fKeep = 0; ps->nextpap.fKeepFollow = 0; ps->nextpap.reserved1 = 0; ps->nextpap.ilvl = 0; ps->nextpap.fNoLnn = 0; ps->nextpap.ilfo = 0; ps->nextpap.nLvlAnm = 0; ps->nextpap.reserved2 = 0; ps->nextpap.fSideBySide = 0; ps->nextpap.reserved3 = 0; ps->nextpap.fNoAutoHyph = 0; ps->nextpap.fWidowControl = 0; ps->nextpap.dxaRight = 0; ps->nextpap.dxaLeft = 0; ps->nextpap.dxaLeft1 = 0; ps->nextpap.lspd.dyaLine = 0; ps->nextpap.lspd.fMultLinespace = 0; ps->nextpap.dyaBefore = 0; ps->nextpap.dyaAfter = 0; ps->nextpap.fCrLf = 0; ps->nextpap.fUsePgsuSettings = 0; ps->nextpap.fAdjustRight = 0; ps->nextpap.reserved4 = 0; ps->nextpap.fKinsoku = 0; ps->nextpap.fWordWrap = 0; ps->nextpap.fOverflowPunct = 0; ps->nextpap.fTopLinePunct = 0; ps->nextpap.fAutoSpaceDE = 0; ps->nextpap.fAtuoSpaceDN = 0; ps->nextpap.wAlignFont = 0; ps->nextpap.fInTable = 0; ps->nextpap.fTtp = 0; ps->nextpap.wr = 0; ps->nextpap.fLocked = 0; ps->nextpap.dxaAbs = 0; ps->nextpap.dyaAbs = 0; ps->nextpap.dxaWidth = 0; ps->nextpap.dxaFromText = 0; ps->nextpap.dyaFromText = 0; ps->nextpap.lvl = 0; ps->nextpap.fNumRMIns = 0; ps->nextpap.fPropRMark = 0; ps->nextpap.ibstPropRMark = 0; ps->nextpap.itbdMac = 0; ps->fspa = NULL; ps->fspapos = NULL; ps->nooffspa = 0; ps->fdoa = NULL; ps->fdoapos = NULL; ps->nooffdoa = 0; // ------------------------------------------------- Cheers, Golan __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |