diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-02-06 22:43:36 -0600 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2019-02-07 05:52:19 +0100 |
commit | 60f60d9a12977cea8329b0b1c68981a2ad87b392 (patch) | |
tree | 276ebbb6f96ad974ea5ba0142c530fe085aff845 /apps/tree.c | |
parent | 1d893a05c6b3e73a8cda660d4a4cbc209c0fe0d9 (diff) | |
download | rockbox-60f60d9a12977cea8329b0b1c68981a2ad87b392.tar.gz rockbox-60f60d9a12977cea8329b0b1c68981a2ad87b392.zip |
Fix tree.c static allocation detection during buffer move
Change-Id: I170177ff331f33961863eff0dd3ba5c570a3961d
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
1044 | if (cache->lock_count > 0) | 1044 | if (cache->lock_count > 0) |
1045 | return BUFLIB_CB_CANNOT_MOVE; | 1045 | return BUFLIB_CB_CANNOT_MOVE; |
1046 | 1046 | ||
1047 | ptrdiff_t diff = (int32_t *) new - (int32_t *) current; | 1047 | ptrdiff_t diff = new - current; |
1048 | /* FIX_PTR makes sure to not accidentally update static allocations */ | 1048 | /* FIX_PTR makes sure to not accidentally update static allocations */ |
1049 | #define FIX_PTR(x) \ | 1049 | #define FIX_PTR(x) \ |
1050 | { if ((void*)x >= current && (void*)x < (current+cache->name_buffer_size)) x+= diff; } | 1050 | { if ((void*)x >= current && (void*)x < (current+cache->name_buffer_size)) x+= diff; } |