[Code] spell name is hanging the MUD

From: The Realms of Tremaria (tremaria@cyber-safari.com)
Date: 11/26/98

Hello all.

We have added a few new spells to the MUD and everything works fine,
except when the spell hits void say_spell.

void say_spell(struct char_data * ch, int spellnum, struct char_data *tch,
                    struct obj_data * tobj)
  char lbuf[256];

  struct char_data *i;
  int j, ofs = 0;
  *buf = '\0';
  strcpy(lbuf, spells[spellnum]);

        while (*(lbuf + ofs)) {
                for (j = 0; *(syls[j].org); j++) {
                        if (!strncmp(syls[j].org, lbuf + ofs, strlen(syls[j].org))) {
                                strcat(buf, syls[j].new);
                                ofs += strlen(syls[j].org);

The MUD is hanging at this loop when I try to cast the spell 'monster
summoning I', but if I cast a spell of equal or greater length it still
runs fine.  So I am forced to use the following before the while loop:

  if (spellnum != SPELL_MONSTER_SUMMONING_I)

What is the problem, and what is a possible solution?

Thank you,


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |

This archive was generated by hypermail 2b30 : 12/15/00 PST