From 0a5b0dd9081a83a9a8f6abec9bde04a594cc337e Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 14 Jan 2017 00:20:07 -0500 Subject: [PATCH] Dircache: Fix a tiny-block reclaim bug Logic left over from before switching from NULL-terminated to counted strings would prevent a single-byte tiny free block gap from being properly reclaimed into free string bytes. Due to rarity, not as disasterous to functionality so much as wrong. Change-Id: I68e0875b04bb0ab6cdead0fdf535144b9c1bc13e --- firmware/common/dircache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 96b06eb547..b93ee73fc6 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -849,7 +849,7 @@ static void free_name(int nameidx, size_t size) while (beg[-1] == 0xfe) --beg; - while (end[1] == 0xfe) + while (end[0] == 0xfe) ++end; size = end - beg;