From: Thomas W. <tt...@sh...> - 2001-05-28 08:41:01
|
The LifeLines substring function is not the "obvious" algorithm, but one of the faster ones that precomputes information needed for making some jump aheads. It's been a long time since I wrote that, and I forget what I read as the basis of that algo, but the clue is in the comment to ll_index -- it's the KMP algorithm. Tom W. On Monday, May 28, 2001, at 01:41 AM, prapp wrote: > Does anyone understand ll_index & pi & compute_pi ? > more.c (circa line 369) > > I'm fixing substring so that it is not subject to buffer overflows > (this is what was crashing in a recent bug report), and I think that > pi being a fixed length means it needs to be protected against > buffer overflow as well, but I don't follow the code. > > I'm changing substring to dynamically allocate a buffer of the > appropriate size. Perhaps there should be a sanity upper-limit > on the string size, but I'm not sure what would be appropriate. > > > > > _______________________________________________ > Lifelines-dev mailing list > Lif...@li... > http://lists.sourceforge.net/lists/listinfo/lifelines-dev > |