Commit 17546f53 authored by Nikias Bassen's avatar Nikias Bassen

plist_set_key_val(): prevent setting a key value that already exists in a PLIST_DICT

parent ea37ed01
......@@ -1067,6 +1067,11 @@ static void plist_set_element_val(plist_t node, plist_type type, const void *val
PLIST_API void plist_set_key_val(plist_t node, const char *val)
{
plist_t father = plist_get_parent(node);
plist_t item = plist_dict_get_item(father, val);
if (item) {
return;
}
plist_set_element_val(node, PLIST_KEY, val, strlen(val));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment