cache: fix bug
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 16 Aug 2019 15:47:59 +0000 (17:47 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 16 Aug 2019 15:47:59 +0000 (17:47 +0200)
Change-Id: Ie1d65068f962335b46bd2ca259a002eb559db83c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/cache.c

index 3b98c1e..ca4234a 100644 (file)
@@ -91,7 +91,7 @@ drop_at(
        l = itemat(cache, pos)->length;
        e = pos + l;
        cache->used -= l;
-       if (cache->used > e)
+       if (cache->used > pos)
                memmove(&cache->content[pos], &cache->content[e], cache->used - pos);
 }