Re: [dgscripts] pl8 real_trigger()

From: Thomas Arp (t_arp@stofanet.dk)
Date: 08/03/02


From: "Russell Ryan" <rjwr10@HOTMAIL.COM>
> in dg_scripts.c:3228
> I get a seg fault there, btw im on a fresh bpl21,
> olc2.0.1 bpl21, dg scripts pl8.
> It would happen when i would trigedit a non-existant vnum.
> ie trigedit 5700 (zone 57 exists btw 5700-5799)
>
> int real_trigger(int vnum)
> {
>   int bot = 0, mid;
>   int top = top_of_trigt;
>
>   /* perform binary search on trigger-table */
>   for (;;) {
>     mid = (bot + top) / 2;
>
>
++  if (bot >= top)
++      return (NOTHING);
>     if (trig_index[mid]->vnum == vnum)
>       return (mid);
--  if (bot >= top)
--      return (NOTHING);
>     if (trig_index[mid]->vnum > vnum)
>       top = mid - 1;
>     else
>       bot = mid + 1;
>   }
> }

This should fix your problem.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT