summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-01-27 00:09:05 -0500
committerOri Bernstein <ori@eigenstate.org>2013-01-27 00:09:05 -0500
commita6dba3024d23330b32c8ebab7ac6cb78a0c09b1f (patch)
treea97a3a956908df05c9ebf7bc4cfde835d6ba8a52
parentb0d94f7837667c2a95596db88df458bdd3388224 (diff)
downloadmc-a6dba3024d23330b32c8ebab7ac6cb78a0c09b1f.tar.gz
Fix offsets when moving block in ldel(). Thought I already did this.
-rw-r--r--parse/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/util.c b/parse/util.c
index 436b014..8760b68 100644
--- a/parse/util.c
+++ b/parse/util.c
@@ -148,7 +148,7 @@ void ldel(void *p, size_t *len, size_t idx)
assert(idx < *len);
pl = p;
l = *pl;
- memmove(&l[idx - 1], &l[idx], (*len - idx)*sizeof(void*));
+ memmove(&l[idx], &l[idx + 1], (*len - idx - 1)*sizeof(void*));
(*len)--;
*pl = xrealloc(l, *len * sizeof(void*));
}