Re: strdup or str_dup?

From: Acido (acido@dvmud.net)
Date: 03/10/99


At 10:54 PM 3/9/99 +0000, you wrote:
>On 3/10/99 3:13 AM, Acido (acido@dvmud.net) stated:
>
>>Uhm so i get the idea it's a pretty bad thing if it dosn't crash in most
>>cases.
>>So how do i make sure that it DO crash and dump core acordingly??
>>
>>After reading this thread i was about to make a NULL check but i'm having
>>second throughts about this after reading this post (we all know dak is
>>always right all the time hehe :)
>
>You could do both - dump a core, log a message, and stay up:
>
>
>if (!str) {
>     log("Null string passed to str_dup.");
>     if (!fork())
>          raise(SIGSEGV);
>}
>
>
>or could use abort(); instead of raise().
>
>- Chris Jacobson

But if staying up could mean corrupt data in eg. pfiles (can't remember in
my head of save_char() calls str_dup() right now though.. it would be a
pretty bad thing to stay up i figure.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST