summaryrefslogtreecommitdiff
path: root/new/stack.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-14 10:35:52 -0400
committerPietro Gagliardi <[email protected]>2015-04-14 10:35:52 -0400
commitbbc170ac49fe396aac688959381505e515553c2b (patch)
treeb2d4f8820d1c52a3adcc9520ae20605d7bf5ba69 /new/stack.c
parent6185187506dd4bebaa801aaa1d4d1c783557e786 (diff)
Fixed a small bug in stack.c. Unrelated to the previous commit; that one is that the uiParentUpdate() isn't updating...?
Diffstat (limited to 'new/stack.c')
-rw-r--r--new/stack.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/new/stack.c b/new/stack.c
index a5de6a4..480b2f0 100644
--- a/new/stack.c
+++ b/new/stack.c
@@ -365,12 +365,13 @@ void uiStackRemove(uiControl *st, uintmax_t index)
{
stack *s = (stack *) (st->data);
uiControl *removed;
- uintmax_t nAfter;
+ uintmax_t i;
removed = s->controls[index].c;
- nAfter = s->len - index - 1;
- // TODO make sure this is correct
- memmove(&(s->controls[index + 1]), &(s->controls[index]), nAfter * sizeof (stackControl));
+ // TODO switch to memmove?
+ for (i = index; i < s->len - 1; i++)
+ s->controls[i] = s->controls[i + 1];
+ // TODO memset the last one to NULL
s->len--;
if (s->parent != NULL) {
uiControlSetParent(removed, NULL);