wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 4d75de44405ef9ecab8fecdca9addd25c3447cfd
parent 09976386ae0510158336d4199817b4f91cd66e5b
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Mon, 10 Apr 2006 10:25:44 +0200

thanks to usa, fixed the issues mentioned in IRC


Diffstat:
libcext/vector.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libcext/vector.c b/libcext/vector.c @@ -14,7 +14,7 @@ cext_vattach(Vector *v, void *p) fprintf(stderr, "%s\n", "Out of memory in cext_evector_attach\n"); exit(1); } - v->data[v->size - 1]=p; + v->data[v->size - 1] = p; } void @@ -25,9 +25,11 @@ cext_vdetach(Vector *v, void *data) if (v->data[i] == data) { memmove(v->data + i, v->data + i + 1, (v->size - i - 1) * sizeof(void *)); - --v->size; - return; + v->data[--v->size] = nil; + break; } - if(v->size == 0) + if(v->size == 0) { free(v->data); + v->data = nil; + } }