My problem is this...Every time a character quits from my mud, it crashes.
I ran the debugger to find the exact line it was falling out...and it was in
the do_quit function when it calls the str_dup function...here...
/*
* After extract_char the ch is no longer valid!
*/
save_char_obj( ch );
id = ch->id;
d = ch->desc;
d->host = str_dup(ch->pcdata->host);
extract_char( ch, TRUE );
if ( d != NULL )
close_socket( d );
Then, when I stepped into the str_dup function, it craps out with an "Access
violation"...here...
char *str_dup( const char *str )
{
char *str_new;
if ( str[0] == '\0' ) /* Right here, on this line, is where it
craps out*/
return &str_empty[0];
if ( str >= string_space && str < top_string )
return (char *) str;
str_new = alloc_mem( strlen(str) + 1 );
strcpy( str_new, str );
return str_new;
}
The mud was running fine, but for a problem with do_outfit that had to do
with the create_object and a null pObjIndex pointer....
but when I fixed that (a temporary fix, by basically commenting out the
outfit command)...this started happening. When before I could quit out with
no problem...
and now...even when I uncomment the do_outfit.. it is still having this
problem with the access violation.
Honestly, I am stumped.