summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/TextAction.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/TextAction.c b/src/TextAction.c
index f5aaac7..2ec0d97 100644
--- a/src/TextAction.c
+++ b/src/TextAction.c
@@ -1218,7 +1218,7 @@ ExtendEnd(Widget w, XEvent *event, String *params, Cardinal *num_params)
static void
SelectSave(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
- int num_atoms;
+ int num_atoms, n;
Atom* sel;
Display* dpy = XtDisplay(w);
Atom selections[256];
@@ -1227,9 +1227,8 @@ SelectSave(Widget w, XEvent *event, String *params, Cardinal *num_params)
num_atoms = *num_params;
if (num_atoms > 256)
num_atoms = 256;
- for (sel=selections; --num_atoms >= 0; sel++, params++)
+ for (sel = selections, n = 0; n < num_atoms; n++, sel++, params++)
*sel = XInternAtom(dpy, *params, False);
- num_atoms = *num_params;
_XawTextSaltAwaySelection( (TextWidget) w, selections, num_atoms );
EndAction( (TextWidget) w );
}