mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
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
This commit is contained in:
parent
df448bf7a1
commit
ccaf55a8ae
2 changed files with 2 additions and 2 deletions
|
@ -190,7 +190,7 @@ static int move_callback(int handle, void* current, void* new)
|
||||||
(void)handle;
|
(void)handle;
|
||||||
size_t diff = new - current;
|
size_t diff = new - current;
|
||||||
#define FIX_PTR(x) \
|
#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++)
|
for(int i = 0; i < filetype_count; i++)
|
||||||
{
|
{
|
||||||
FIX_PTR(filetypes[i].extension);
|
FIX_PTR(filetypes[i].extension);
|
||||||
|
|
|
@ -1019,7 +1019,7 @@ static int move_callback(int handle, void* current, void* new)
|
||||||
size_t diff = new - current;
|
size_t diff = new - current;
|
||||||
/* FIX_PTR makes sure to not accidentally update static allocations */
|
/* FIX_PTR makes sure to not accidentally update static allocations */
|
||||||
#define FIX_PTR(x) \
|
#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)
|
if (handle == cache->name_buffer_handle)
|
||||||
{ /* update entry structs, *even if they are struct tagentry */
|
{ /* update entry structs, *even if they are struct tagentry */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue