Oops, Windows doesn't offer strndup().  Use g_strndup().