Re: str_cmp / strcasecmp

From: George Greer (
Date: 02/18/02

On Sun, 17 Feb 2002, Daniel A. Koepke wrote:

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

It also obscures memory leak tracking and doesn't take into account any
possible architecture optimizations.  We could wrap it up in:

  char *str_dup(const char *dupme)
    char *tmp;

    if (!(tmp = strdup(dupme)))

    return tmp;

but a MUD should be one of the first things to die if a machine is really
running out of memory. Much better than killing inetd or sshd.

George Greer

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

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