strdup

VLD/VMB gwyn at BRL.ARPA
Thu Aug 28 02:27:11 AEST 1986


As a point of information, strdup() is listed in the SVR3 manual.

I'm not sure how useful it really is, since one still has to test
the returned pointer to handle the out-of-memory situation.  When
I implement my own strdup() in an application, instead of returning
NULL the function typically enters a termination routine.  That way
the main body of code remains simple and straightforward.  The exact
error handling approach is clearly application-specific; the problem
with strdup() is that many programmers will not bother to test for
failure, with the result of reduced code reliability.



More information about the Comp.unix mailing list