fixed using wrong length when copying debug entries function name

This commit is contained in:
Martin Fouilleul 2023-04-21 10:02:17 +02:00
parent 28a4fe0579
commit 58effcb413
1 changed files with 3 additions and 2 deletions

View File

@ -195,7 +195,7 @@ void orca_log(log_level level,
payload += entry->msg.len; payload += entry->msg.len;
memcpy(entry->file.ptr, file, fileLen); memcpy(entry->file.ptr, file, fileLen);
memcpy(entry->function.ptr, function, fileLen); memcpy(entry->function.ptr, function, functionLen);
memcpy(entry->msg.ptr, msg, msgLen); memcpy(entry->msg.ptr, msg, msgLen);
entry->level = level; entry->level = level;
@ -757,7 +757,7 @@ int main(int argc, char** argv)
orca->debugOverlay.canvas = mg_canvas_create(orca->debugOverlay.surface); orca->debugOverlay.canvas = mg_canvas_create(orca->debugOverlay.surface);
orca->debugOverlay.fontReg = orca_font_create("../resources/Menlo.ttf"); orca->debugOverlay.fontReg = orca_font_create("../resources/Menlo.ttf");
orca->debugOverlay.fontBold = orca_font_create("../resources/Menlo Bold.ttf"); orca->debugOverlay.fontBold = orca_font_create("../resources/Menlo Bold.ttf");
orca->debugOverlay.maxEntries = 30; orca->debugOverlay.maxEntries = 200;
mem_arena_init(&orca->debugOverlay.logArena); mem_arena_init(&orca->debugOverlay.logArena);
mg_surface_set_hidden(orca->debugOverlay.surface, true); mg_surface_set_hidden(orca->debugOverlay.surface, true);
@ -777,6 +777,7 @@ int main(int argc, char** argv)
//NOTE: show window and start runloop //NOTE: show window and start runloop
mp_window_bring_to_front(orca->window); mp_window_bring_to_front(orca->window);
mp_window_focus(orca->window); mp_window_focus(orca->window);
mp_window_center(orca->window);
pthread_t runloopThread; pthread_t runloopThread;
pthread_create(&runloopThread, 0, orca_runloop, 0); pthread_create(&runloopThread, 0, orca_runloop, 0);