Re: strdup or str_dup?

From: Chris Jacobson (fear@technologist.com)
Date: 03/09/99


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


     +------------------------------------------------------------+
     | 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