Hey all, maybe someone can help me with this, this is part of my random
item gen, pills specificly..
Anywho, its crashing with (cygwin)
Program received signal SIGSEGV, Segmentation fault.
0x610b7841 in memmove () from /usr/bin/cygwin1.dll
and (in linux)
Program received signal SIGSEGV, Segmentation fault.
0x400beabc in _IO_str_overflow () from /lib/i686/libc.so.6
I am confused.. ive never seen this before..
As far as i can tell, i dont know whats causing this. While writing this
email ;) i remembered somewhere else i saw something im trying to achive,
so i changed the
sprintf for the short descr to
sprintf (prefix_full, "a small pill of %s",
skill_table[spell_num].name);
and it causes the same problems.
Any help would be appreciated.. (oye im bad at this ;)
-Thri
Code snip below
OBJ_DATA *
thri_rand_item_pill (OBJ_DATA * obj, int level)
{
char prefix_full[MSL];
int spell_num;
char spell_buf;
int find_spell = number_range(1, 2);
switch (find_spell)
{
case 1:
spell_num = skill_lookup ("detect invis");
sprintf( spell_buf, "detect invis");
break;
case 2:
spell_num = skill_lookup ("detect hidden");
sprintf( spell_buf, "detect hidden");
break;
}
obj = create_object (get_obj_index (30230), 0);
obj->value[0] = level / 2;
obj->value[1] = spell_num;
sprintf (prefix_full, "a small pill of %s", spell_buf);
obj->short_descr = str_dup (prefix_full);
return(obj);
}