#6 0x08066cbd in do_step (ch=0x891e9f8, argument=0xbf8db960 "\002") at act_move.c:4087
Backtrace stopped: frame did not save the PC
(gdb) frame 6
#6 0x08066cbd in do_step (ch=0x891e9f8, argument=0xbf8db960 "\002") at act_move.c:4087
4087 if((org = org_lookup(argument)) == NULL
(gdb) info local
i = -1081231008
count = <value optimized out>
buf = '\000' <repeats 316 times>, "../area", '\000' <repeats 2213 times>"\266, ;\246", '\000' <repeats 37 times>"\240, \234\v\b\020
\000\000\000\350\000\000\000h\263\215\277. \b\b\020\000\000\000\240\234\v\b\000\000\000\000\000\000\000\000t\000\000\000t
\000\000\000x\263\215\277t\000\000\000t\000\000\000\350\000\000\000\210\263\215\277\070G\006\bt\000\000\000t\000\000
\000\250\263\215\277\242H\006\bt\000\000\000\000\000\000\000\220\326\374\267\022\000\000\000\000\000\000\000+\321
\b\bh\264\215\277\325l\b\bt", '\000' <repeats 27 times>"\200, G\006\b\000\000\000\000\356\377\377\377", '\000' <repeats 12
times>, "s\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\266;\246", '\000' <repeats 25 times>"\355, \377\377
\377\000\000\000\000\000\000\000\000\240\234\v\b\020\000\000\000\024\000\000\000H\264\215\277. "…
rch = <value optimized out>
location = 0x0
org = <value optimized out>
(gdb) list
4082 return;
4083 }
4084
4085 if((i = flag_value(rp_area_table, argument)) == NO_FLAG)
4086 {
4087 if((org = org_lookup(argument)) == NULL
4088 || !get_room_index(i = org->step_point))
4089 {
4090 if(!str_prefix(argument, "home")
4091 && (ch->home == 0 || !get_room_index(i = ch->rooms[0]->vnum)))
(gdb)
do_step(CHAR_DATA *ch, char *argument)
{
int i;
int count = 0;
char buf[MAX_STRING_LENGTH];
CHAR_DATA *rch;
ROOM_INDEX_DATA *location;
ORG_DATA *org;
/*
* Added org stepping. Dsarky.
* Added home stepping. Dsarky.
*/
/* Added a better way of displaying the steps by adding the count feature
* so that it would display much like the abilities and powers do. Also
* looks a hell of a lot better. Rayal.
*/
if(argument[0] == '\0')
{
send_to_char("\tGAvailable locations are\tn:\n\r", ch);
for(i=0;rp_area_table[i].name != NULL;i++)
{
if(rp_area_table[i].settable == TRUE) {
snprintf(buf, MSL, "\t<send href='step %s'>%-20s\t</send> |", rp_area_table[i].name, rp_area_table[i].name);
send_to_char(buf, ch);
count++;if(!(count%3)) send_to_char("\n\r", ch);
}
}
for(org = org_list; org; org = org->next)
{
if(mem_lookup(org, ch->name))
{
snprintf(buf, MSL, "\t<send href='step %s'>%-20s\t</send> |", org->name, org->name);
send_to_char(buf, ch);
count++;if(!(count%3)) send_to_char("\n\r", ch);
}
}
if(ch->home > 0)
{
snprintf(buf, MSL, "\t<send href='step %s'>%-20s\t</send> |", "home", "home");
send_to_char(buf, ch);
count++;if(!(count%3)) send_to_char("\n\r", ch);
}
send_to_char("\n\r", ch);
return;
}
if(ch->in_room->vnum == ROOM_VNUM_GAOL)
{
send_to_char("The jail attendant laughs at your request for a taxi.\n\r", ch);
return;
}
if((i = flag_value(rp_area_table, argument)) == NO_FLAG)
{
if((org = org_lookup(argument)) == NULL || !get_room_index(i = org->step_point))
{
if(!str_prefix(argument, "home") && (ch->home == 0 || !get_room_index(i = ch->rooms[0]->vnum)))
{
send_to_char("No such step point available.\n\r", ch);
return;
}
}
}
if(i != flag_value(rp_area_table, "school") && ch->dollars + (ch->cents / 100) < 5 && !IS_ADMIN(ch))
{
send_to_char("You don't have $5 to pay for the taxi!\n\r", ch);
return;
}
if((location = get_room_index(i)) == NULL)
{
send_to_char("\tOThere seems to have been a mistake.\tn\n\r", ch);
send_to_char("\tOPlease report that target location as being unavailable.\tn\n\r", ch);
snprintf(buf, MSL, "\tOIssue with Room Vnum: %d\tn", i);
send_to_char(buf, ch);
return;
}
for (rch = ch->in_room->people; rch != NULL; rch = rch->next_in_room)
{
if (get_trust(rch) >= ch->invis_level)
{
if (ch->pcdata != NULL && ch->pcdata->bamfout[0] != '\0')
act("$t",ch,ch->pcdata->bamfout,rch,TO_VICT,0);
else
act("$n leaves, catching a taxi to another area.",ch, NULL,rch,TO_VICT,0);
}
}
char_from_room( ch );
char_to_room( ch, location );
for (rch = ch->in_room->people; rch != NULL; rch = rch->next_in_room)
{
if (get_trust(rch) >= ch->invis_level)
{
if (ch->pcdata != NULL && ch->pcdata->bamfin[0] != '\0')
act("$t",ch,ch->pcdata->bamfin,rch,TO_VICT,0);
else
act("$n has arrived.",ch,NULL,rch,TO_VICT,0);
}
}
do_function( ch, &do_look, "auto" );
if(!IS_ADMIN(ch) && i != flag_value(rp_area_table, "school"))
{
if(ch->dollars >= 5)
ch->dollars -= 5;
else {
ch->cents -= (5 - ch->dollars) * 100;
ch->dollars = 0;
}
send_to_char("You pay the taxi driver the $5 you owe him for the trip.\n\r", ch);
}
}
char blah[80];
snprintf(blah, 85, "<85+ chars worth of stuff>");
I was converting my sprintf to snprint's and seem to have hit a snag. I'm now segfaulting. I guess I found an error. However, I'm not super good with GDB yet, but this is where I am at so far:
What should I do next?