each time a char has a shield wearing it they kill mob and half way
through the battle it pretty much doesnt like it good oh gdb tells me

Program received signal SIGSEGV, Segmentation fault.
0x08090001 in str_dup (str=0x16 <Address 0x16 out of bounds>) at db.c:3546
3546        if ( str[0] == '\0' )
(gdb)


Code:
/*
 * Duplicate a string into dynamic memory.
 * Fread_strings are read-only and shared.
 */
char *str_dup( const char *str )
{
    char *str_new;

    if ( str[0] == '\0' )
        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;
}

can someone lead me in some kinda direction cause im stumped.


Reply via email to