From fdc5e8760fb7ac0af8e7ebb98a2076db15e31082 Mon Sep 17 00:00:00 2001 From: aura Date: Mon, 16 Mar 2026 10:15:01 +0100 Subject: giga refactor, fix ALL the leaks --- src/editor/editor.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/editor/editor.cpp') diff --git a/src/editor/editor.cpp b/src/editor/editor.cpp index dee5080..e2267b8 100644 --- a/src/editor/editor.cpp +++ b/src/editor/editor.cpp @@ -604,8 +604,8 @@ STAT editor_new_map( GAME_EDITOR* e, const char* mapname ) { WORLD_MAP* m = new WORLD_MAP; defer( map_free( e->game, m ) ); - strcpy( m->name, mapname ); - strcat( m->name, ".hmap" ); + m->name = mapname; + m->name += ".hmap"; m->startpos = { 10.f, 10.f, 0.f }; m->props.push( { .clr = { 1.f, 1.f, 1.f, 1.f } } ); @@ -641,11 +641,10 @@ STAT editor_save_map( GAME_EDITOR* e ) { if( !serialized ) return STAT_ERR; defer( cfg_free( serialized ) ); - char full_path[256]; - sprintf( full_path, "../assets/maps/%s", e->map->name ); + STR full_path = { "../assets/maps/%s", e->map->name.data }; if( !OK( cfg_save( serialized, full_path ) ) ) { - dlog( "failed to save map %s", full_path ); + dlog( "failed to save map %s", full_path.data ); return STAT_ERR; } -- cgit v1.2.3