[Bugfix] Improved_edit nullstring bug

From: Sammy (Samedi@cris.com)
Date: 12/24/96


Sombody found that when using obuild, if you clear the text buffer in
improved_edit, then save, it crashes.  I looked into this, and it seems
like there's a problem with the improved editor, unless I missed something
when I modified obuild to work with it.  Here's how I fixed it:

In modify.c, function string_add, line 613 (your code may vary) looks like
this:

	if(terminator == 1) {

Change this to:

	if(terminator == 1 && *d->str) {

And at line 620, change this:

	  free(*d->str);

To this:

	  if(*d->str)
	    free(*d->str);

I'd suggest that anyone using the improved editor implement this fix.  You
never can have too much error checking, ya know :)

Sam

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