font: logf: fix pointer in buflibmove_callback

Buffer contents are only moved after the callback
returns, so we need to log the path before it has
been updated to prevent reading garbage.

Change-Id: I187fbd56484249c456155ffcbdde9e44e766dde8
This commit is contained in:
Christian Soffke 2026-01-10 07:11:51 +01:00
parent 752467dee4
commit 3da69af83c

View file

@ -121,6 +121,7 @@ static int buflibmove_callback(int handle, void* current, void* new)
struct buflib_alloc_data *alloc = (struct buflib_alloc_data*)current;
ptrdiff_t diff = new - current;
logf("%s %s", __func__, alloc->path);
#define UPDATE(x) if (x) { x = PTR_ADD(x, diff); }
UPDATE(alloc->font.bits);
@ -134,7 +135,6 @@ static int buflibmove_callback(int handle, void* current, void* new)
UPDATE(alloc->font.cache._index);
UPDATE(alloc->font.cache._lru._base);
logf("%s %s", __func__, alloc->path);
return BUFLIB_CB_OK;
}
static void lock_font_handle(int handle, bool lock)