diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 7cfed3a82..c3eac9f92 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -1988,11 +1988,10 @@ common_gtk_main( struct configured_features *my_config) if (my_config->is_cflash_configured) addon_type = NDS_ADDON_CFLASH; - if(my_config->gbaslot_rom != "") - { - addon_type = NDS_ADDON_GBAGAME; - strcpy(GBAgameName, my_config->gbaslot_rom.c_str()); - } + if(my_config->gbaslot_rom != "") { + addon_type = NDS_ADDON_GBAGAME; + strncpy(GBAgameName, my_config->gbaslot_rom.c_str(), MAX_PATH); + } switch (addon_type) { case NDS_ADDON_CFLASH: