[Circle] Small Bug report

From: Shawn J. Wallace (shawn@gusto.net)
Date: 11/26/96


At 10:21 AM 11/26/96 -0500, you wrote:

The section of code below is responsible for making the gobbledygook words
that are said while casting.  The problem is that an infinite loop occurs
when spells aren't in all lowercase.  To fix it, change the 4th line from a
strncmp to a strncasecmp.  You suffer a marginal performance hit, but at
least it catches any mistakes.

>  while (*(lbuf + ofs)) {
>    log("Starting the say_spell while/for loop!");
>    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);
>      }
>    }
>  }

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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