From 60f60d9a12977cea8329b0b1c68981a2ad87b392 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Wed, 6 Feb 2019 22:43:36 -0600 Subject: Fix tree.c static allocation detection during buffer move Change-Id: I170177ff331f33961863eff0dd3ba5c570a3961d --- apps/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tree.c b/apps/tree.c index fc7998ad7d..9581ef8531 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1044,7 +1044,7 @@ static int move_callback(int handle, void* current, void* new) if (cache->lock_count > 0) return BUFLIB_CB_CANNOT_MOVE; - ptrdiff_t diff = (int32_t *) new - (int32_t *) current; + ptrdiff_t diff = new - current; /* FIX_PTR makes sure to not accidentally update static allocations */ #define FIX_PTR(x) \ { if ((void*)x >= current && (void*)x < (current+cache->name_buffer_size)) x+= diff; } -- cgit v1.2.3