Re: [Code] new_prompt.diff patch

From: John Evans (evansj@texas.net)
Date: 02/25/97


On Tue, 25 Feb 1997, E. Schwim wrote:

> Has anybody had problems after installing this patch?  It works fine, but
> whenever a
> PC tries to save, the mud crashes...

I had this same problem. I tracked it down to the fact that a custom
prompt longer than 256 bytes long would crash the mud when it
(was attempting to be) displayed. I didn't have any problems with people
saving, but the prompt display is called more often than the character
save, so I prolly didn't have time to get to that stage.

Also, one of the default prompts (#3 I think) jumped over this limit.

In structs.h I changed:
#define MAX_INPUT_LENGTH        256

to be:
#define MAX_INPUT_LENGTH        512

This stopped the crashes, but required a pwipe (or player conversion).

I also added in some code to make sure that no one could make a custom
prompt above this new 512 byte limit. Keep in mind that each color change
is approx 10 bytes in size, and the %o and %t flags in the prompt have
several color changes and data up to an additional 40? bytes (20 bytes for
%t) for the name of the mob/player that will be displayed.

I hope this helps some.

John Evans

mailto:evansj@texas.net
http://www.texas.net/~evansj   [RPGs, SCA, MUDs and Search Engines]
slanted.elfwerks.com:2020      [Slanted Reality]

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



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