replace snprintf with strlcpy