Re: Sedit Crashing MUD with free().

From: Pete Johnson (ukrawbones@AOL.COM)
Date: 06/09/02


Ive had this problem as well, it seems to be inherent in most copies.

One fix that does work needs 2 small alterations to genshp.c
Part 1.
=======

  /*
   * Copy notification strings over.
   */
  /*free_shop_strings(tshop);*/
  S_NOITEM1(tshop) = str_udup(S_NOITEM1(fshop));
  S_NOITEM2(tshop) = str_udup(S_NOITEM2(fshop));
  S_NOCASH1(tshop) = str_udup(S_NOCASH1(fshop));
  S_NOCASH2(tshop) = str_udup(S_NOCASH2(fshop));
  S_NOBUY(tshop) = str_udup(S_NOBUY(fshop));
  S_BUY(tshop) = str_udup(S_BUY(fshop));
  S_SELL(tshop) = str_udup(S_SELL(fshop));
}

with this one either comment out the line

free_shop_strings(tshop); as shown above, or delete it.

Part 2
======

  /*
   * The shop already exists, just update it.
   */
  if ((rshop = real_shop(S_NUM(nshp))) != NOWHERE) {
 free_shop_strings(&shop_index[rshop]);
    copy_shop(&shop_index[rshop], nshp);

add the line

free_shop_strings(&shop_index[rshop]);

as shown above

--
   +---------------------------------------------------------------+
   | 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