Use strncat_s instead of snprintf for errors