From: <li...@yo...> - 2007-07-19 17:31:31
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1184866042 -3600 # Node ID 354c03e692572b71d25153034afc4cfff32b97bf # Parent dd89cd84287d1f961c4a1c104192debff632fb02 Use asprintf when generating the decoder priority description. diff -r 354c03e692572b71d25153034afc4cfff32b97bf -r dd89cd84287d1f961c4a1c104192debff632fb02 src/xine-engine/load_plugins.c --- a/src/xine-engine/load_plugins.c Thu Jul 19 18:27:22 2007 +0100 +++ b/src/xine-engine/load_plugins.c Sat Jul 14 14:52:25 2007 +0200 @@ -320,7 +320,6 @@ static void _insert_node (xine_t *this, const input_info_t *input_old; uint32_t *types; char key[80]; - char desc[100]; int i; _x_assert(list); @@ -384,13 +383,8 @@ static void _insert_node (xine_t *this, entry->priority = decoder_new->priority = decoder_old->priority; snprintf(key, sizeof(key), "engine.decoder_priorities.%s", info->id); - snprintf(desc, sizeof(desc), _("priority for %s decoder"), info->id); - /* write the description on the heap because the config system - * does not strdup() it, so we have to provide a different pointer - * for each decoder */ for (i = 0; catalog->prio_desc[i]; i++); - catalog->prio_desc[i] = malloc(strlen(desc) + 1); - strcpy(catalog->prio_desc[i], desc); + asprintf(&catalog->prio_desc[i], _("priority for %s decoder"), info->id); this->config->register_num (this->config, key, 0, |