Revert to using strncpy() instead of strdup() for C11 conformance