[BUGFIX] Improved Edit overflow fixed

From: Chris Jacobson (fear@ATHENET.NET)
Date: 12/28/97


Ok, the problem comes about in that if there is an overflow:

modify.c:string_add()
                if (strlen(str) + strlen(*d->str) > d->max_str) {
                        send_to_char("String too long, limit reached on message.  Last line
ignored.\r\n",
                                        d->character);
                /*
                 * terminator = 1;
                 */
                } else {

It does not auto-abort.

Later on at the end of modify.c:string_add():

        if (terminator) {
...
        } else if (!action)
                strcat(*d->str, "\r\n");

It STILL cats \r\n to the end of the string, even if it is over the max
length.


The fix:
modify.c:string_add() (right at end)

        } else if (!action && (strlen(*d->str) > d->max_str))
                strcat(*d->str, "\r\n");

Cheers!

- Chris Jacobson


     +------------------------------------------------------------+
     | 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/08/00 PST