You may want to consider allocating memmory ???
char *str_dup( const char *str )
{
/* -------- HERE ------*/
char *str_new[MAX_STRING_LENGTH];
if ( str >= string_space && str < top_string )
return (char *) str;
str_new = alloc_mem( strlen(str) + 1 );
strcpy( str_new, str );
return str_new;
}
-----Original Message-----
From: Daniel Scott Wilds [mailto:[EMAIL PROTECTED]
Sent: Friday, April 26, 2002 7:31 PM
To: [email protected]
Subject: shield
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.
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom