Replace sprintf with tor_snprintf