I recently became aware that the strdup()
function I\'ve enjoyed using so much on OS X is not part of ANSI C, but part of POSIX. I don\'t want to rewrite all my
If anyone else reads this: Don't use a platform's strdup() even if available, and don't waste time/effort with autoconf/automake just to use it. Seriously, how hard is this:
char* mystrdup(const char* str)
{
return strcpy(malloc( strlen(str) + 1),str);
}
Does this really warrant #ifdefs? Compiler checks? K.I.S.S.