Re: str_cmp / strcasecmp (strdup!)

From: Mark Garringer (zizazat@HOTMAIL.COM)
Date: 09/03/02

>> I also made str_dup only exist if strdup doesn't.
>I don't think this is a good idea.  Part of the point of str_dup() is that
>it uses CircleMUD's memory management and thus exits with a descriptive
>malloc() failure error rather than simply returning NULL and crashing.

I hate to dust off a super old thread, but I am about to loose my mind with
some NULL crashing strdup crap!!!!!

I'm running on SUSE 8.0, and I keep having problems with redit crashing if
you try to save an empty room desc.

Something like...

(gdb) bt
#0  0x400d08ba in strdup () from /lib/
#1  0x08080c6f in copy_room_strings (dest=0x8100028, source=0x8137350)
    at genwld.c:429
#2  0x08080b52 in copy_room (to=0x8100028, from=0x8137350) at genwld.c:367
#3  0x0807ff27 in add_room (room=0x8137350) at genwld.c:43
#4  0x0809878f in redit_save_internally (d=0x8132ce0) at redit.c:159
#5  0x0809919e in redit_parse (d=0x8132ce0, arg=0xbffff30c "y") at
#6  0x0808b448 in nanny (d=0x8132ce0, arg=0xbffff30c "y") at
#7  0x0806d412 in game_loop (mother_desc=3) at comm.c:755
#8  0x0806cac2 in init_game (port=4001) at comm.c:380
#9  0x0806c993 in main (argc=1, argv=0xbffff6f4) at comm.c:327
#10 0x400749ed in __libc_start_main () from /lib/

So should I be trying to use str_dup instead? I'm not too keen on some of
this...any insight would be very helpful!



   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT