This is an interesting article, but the &quot;Portability&quot; comments could be a lot more useful: strndup and open_memstream are both &quot;POSIX 2008&quot;, but strndup can be used on OS X while open_memstream cannot.