From ccaf55a8ae707951d9e91a799bfa05970df829c9 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 21 Sep 2011 13:32:37 +0000 Subject: [PATCH] fix FIX_PTR macro so it actually fixes every pointer (was skipping x == current case) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30577 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 2 +- apps/tree.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/filetypes.c b/apps/filetypes.c index 8f2e91222a..d275c6501c 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -190,7 +190,7 @@ static int move_callback(int handle, void* current, void* new) (void)handle; size_t diff = new - current; #define FIX_PTR(x) \ - { if ((void*)x > current && (void*)x < (current+strdup_bufsize)) x+= diff; } + { if ((void*)x >= current && (void*)x < (current+strdup_bufsize)) x+= diff; } for(int i = 0; i < filetype_count; i++) { FIX_PTR(filetypes[i].extension); diff --git a/apps/tree.c b/apps/tree.c index ca4c567235..2fcaba74a5 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1019,7 +1019,7 @@ static int move_callback(int handle, void* current, void* new) size_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; } + { if ((void*)x >= current && (void*)x < (current+cache->name_buffer_size)) x+= diff; } if (handle == cache->name_buffer_handle) { /* update entry structs, *even if they are struct tagentry */ -- 2.11.4.GIT