From 9a3bf87ee004a21950663ebba404394e20c79afc Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 21 Jan 2020 14:50:23 +0100 Subject: [PATCH] ecore_x_selection: do not skip any any atoms i dont know why we skipped the first two atoms, but right now, if a application is only providing one single target, we would crash. With this we might copy a few atoms more. However, these atoms do not matter, as we skip those, that we cannot understand Differential Revision: https://phab.enlightenment.org/D11194 --- src/lib/ecore_x/ecore_x_selection.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_x/ecore_x_selection.c b/src/lib/ecore_x/ecore_x_selection.c index 22cd5c8c7f..733b799244 100644 --- a/src/lib/ecore_x/ecore_x_selection.c +++ b/src/lib/ecore_x/ecore_x_selection.c @@ -990,15 +990,15 @@ _ecore_x_selection_parser_targets(const char *target EINA_UNUSED, if (!sel) return NULL; targets = data; - sel->num_targets = size - 2; - sel->targets = malloc((size - 2) * sizeof(char *)); + sel->num_targets = size; + sel->targets = malloc((sel->num_targets) * sizeof(char *)); if (!sel->targets) { free(sel); return NULL; } - for (i = 2; i < size; i++) - sel->targets[i - 2] = XGetAtomName(_ecore_x_disp, targets[i]); + for (i = 0; i < size; i++) + sel->targets[i] = XGetAtomName(_ecore_x_disp, targets[i]); ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_targets_free; ECORE_X_SELECTION_DATA(sel)->content = ECORE_X_SELECTION_CONTENT_TARGETS;