From 42f982f9ef538383d8838b8f81abd5308ee6b55e Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 21 Apr 2011 21:27:49 -0700 Subject: [PATCH] fix unshift --- src/list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/list.c b/src/list.c index 15754bc..753e3b8 100644 --- a/src/list.c +++ b/src/list.c @@ -146,9 +146,9 @@ LakeVal *list_unshift(LakeList *list, LakeVal *val) list_grow(list); } size_t i = list->n++; - while (i--) { + do { list->vals[i] = list->vals[i - 1]; - } + } while (i--); list->vals[0] = val; } return NULL;