strdup(NULL) supposed to create SIGSEGV?
Simun Mikecin
numisemis at yahoo.com
Wed Apr 23 16:06:45 UTC 2008
>If you're going to quote documents to support your ideas, it's probably
>better to read them first.
My apologies. My fingers were faster than my mind. But this made me read it the way I should have
done in the first place. And I see that it says:
"A null pointer is returned if the new string cannot be created."
Does that also mean that a null pointer is returned if the input is a NULL pointer (cause in that
case new string could not be created)?
As other have concluded, standard says that behavior is undefined if the input is invalid (NULL
pointer).
So what is right?
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
More information about the freebsd-hackers
mailing list