void osd_common_t::update_option(const char * key, std::vector<const char *> &values) { std::string current_value(m_options.description(key)); std::string new_option_value(""); for (unsigned int index = 0; index < values.size(); index++) { std::string t(values[index]); if (new_option_value.length() > 0) { if( index != (values.size()-1)) new_option_value.append(", "); else new_option_value.append(" or "); } new_option_value.append(t); } // TODO: core_strdup() is leaked m_options.set_description(key, core_strdup(current_value.append(new_option_value).c_str())); }
void osd_interface::update_option(osd_options &options, const char * key, dynamic_array<const char *> &values) { astring current_value(options.description(key)); astring new_option_value(""); for (int index = 0; index < values.count(); index++) { astring t(values[index]); if (new_option_value.len() > 0) { if( index != (values.count()-1)) new_option_value.cat(", "); else new_option_value.cat(" or "); } new_option_value.cat(t); } // TODO: core_strdup() is leaked options.set_description(key, core_strdup(current_value.cat(new_option_value).cstr())); }