[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] xstrdup.c

From: Derek R. Price
Subject: Re: [Bug-gnulib] xstrdup.c
Date: Mon, 23 Feb 2004 14:32:29 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Bruno Haible wrote:

Derek Robert Price wrote:
Would anyone have any objections to xstrdup(NULL) returning NULL?

Yes. For the developer it's easier to remember if the 'x' stands for just
one thing: checking the memory allocation failures. xmalloc, xstrdup,
xgethostname, xgetcwd, xsetenv, etc. have this in common.

strdup(NULL) is an error, therefore xstrdup(NULL) should continue to be
banned as well.

Fair enough.  Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]