Re: Segfault while in improved editor

From: Mike Breuer (
Date: 10/10/01

----- Original Message -----
From: "Anton Graham" <>

> do_winfo(struct char_data *ch, char *argument, int cmd, int subcmd)
> {
>   struct info_entry entry;
-- snip --
>   string_write(ch->desc, &entry.body, 4096, 0, NULL);
> }

This may not be the only problem, but...

string_write() expects a pointer to a string that will continue to exist
as the user continues to pass commands/text to the improved editor.  You
are passing a member of "entry" which will be deallocated as soon as the
do_winfo exits.  You should attach your string to the char's descriptor
in some way.  Take a look at some of the other places where string_write
is called.


   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST