Use g_strndup() instead of strndup() for better portability.