Welcome to the Builder Academy

Question Crashing with /t in Redit Room Description

More
18 Jun 2012 19:46 - 18 Jun 2012 19:52 #99 by Liko
Hello,

Whenever I put an /t in a room description it crashes the mud. Here is the gdb output
Code:
#0 0xb7e93be3 in strchr () from /lib/libc.so.6 #1 0x080efba5 in parse_edit_action (command=8, string=0xbfffea70 "", d=0x83ae0b8) at improved-edit.c:128 #2 0x080f0b46 in improved_editor_execute (d=0x83ae0b8, str=0xbffff1e8 "") at improved-edit.c:89 #3 0x080fe377 in string_add (d=0x83ae0b8, str=0xbffff1e8 "") at modify.c:141 #4 0x080a5a0e in game_loop (local_mother_desc=7) at comm.c:880 #5 0x080a6b78 in init_game (argc=2, argv=0xbffff784) at comm.c:533 #6 main (argc=2, argv=0xbffff784) at comm.c:356

improved-edit.c line 128 is this
Code:
if (strchr(*d->str, '@')) {

Any ideas where to look? I rechecked to make sure I patched correctly and it looks fine.

Randian(0.0.0)
Owner/Developer
Last edit: 18 Jun 2012 19:52 by Liko.

Please Log in or Create an account to join the conversation.

More
18 Jun 2012 23:22 - 18 Jun 2012 23:23 #100 by Liko
It crashes when you do /t in any editor, including writing mail.

Randian(0.0.0)
Owner/Developer
Last edit: 18 Jun 2012 23:23 by Liko.

Please Log in or Create an account to join the conversation.

More
18 Jun 2012 23:33 - 19 Jun 2012 13:32 #101 by Liko
Update:

It seems typing just /t into an empty buffer will crash the mud

I fixed it with this

in improved-edit.c in void parse_edit_action
Code:
case PARSE_TOGGLE: + if (!*d->str) { + write_to_output(d, "No string.\r\n"); + break; + } if (strchr(*d->str, '@')) { parse_at(*d->str); write_to_output(d, "Toggling (at) into (tab) Characters...\r\n"); } else { parse_tab(*d->str); write_to_output(d, "Toggling (tab) into (at) Characters...\r\n"); } break;

I hope this fix helps others :)

Randian(0.0.0)
Owner/Developer
Last edit: 19 Jun 2012 13:32 by Liko.

Please Log in or Create an account to join the conversation.

More
18 Jun 2012 23:55 #102 by Halenbane
Nicely spotted :)

Please Log in or Create an account to join the conversation.

More
19 Jun 2012 00:00 - 19 Jun 2012 00:03 #103 by Vatiken
1)You are trying to toggle a string that doesn't exist.
Code:
"str=0xbffff1e8 "")
2)Never the less, it's shouldn't crash.

improved_edit.c
Code:
case PARSE_TOGGLE: + if (!*d->str) { + write_to_output(d, "No string.\r\n"); + break; + } if (strchr(*d->str, '@')) { parse_at(*d->str); write_to_output(d, "Toggling (at) into (tab) Characters...\r\n"); } else { parse_tab(*d->str); write_to_output(d, "Toggling (tab) into (at) Characters...\r\n"); } break;

=======================

Dang, beat me to it.

tbaMUD developer/programmer
Last edit: 19 Jun 2012 00:03 by Vatiken. Reason: In my defense, I had this written about 3 hours ago... just couldn't get my truck close enough to hi-jack the McDonalds wifi. :(

Please Log in or Create an account to join the conversation.

More
19 Jun 2012 00:01 #104 by Liko

Halenbane wrote: Nicely spotted :)


It was a quick fix, but it does the job, I wouldn't see the need to /t on a blank buffer anyway.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

Time to create page: 0.196 seconds