A stupid strcpy error...

From: Nick Stout (cyberman_64@HOTMAIL.COM)
Date: 09/22/98


Okay, here's my main problem:
I have a mud with guns coded in on it. Good so far? Yeah.
When i installed the guns, immediately funky things started to happen
with fighting. As soon as it got to "Mortally Wounded" it would crash.
When it did, it would give me an "error in strcpy" in the core.
I think i have pinpointed the problem after a long scan. Line 159 in
act.informative.c (could be less for you) has this:
  strcpy(buf, PERS(i, ch));
Then it proceeds to say:
  CAP(buf);
  if (percent >= 100)
    strcat(buf, " is in excellent condition.\r\n");
  else if (percent >= 90)
    strcat(buf, " has a few scratches.\r\n");
    ...
    strcat(buf, " is in awful condition.\r\n");
  else
    strcat(buf, " is bleeding awfully from big wounds.\r\n");

  send_to_char(buf, ch);
}
The else for bleeding... I know it's like that in stock, but is there a
way to change either the strcpy or the else so it'll work but
different/cleaner? That could be 1 of many errors.. Obviously this code
needs some major attention, and although i can code, i'm afraid this is
one thing i cant do. Suggestions?
-CyberMan

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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