diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 233ec351b..bf2d76719 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8691,7 +8691,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) { if (argc > i+1) { - Bstrcpy(g_modDir,argv[i+1]); + Bstrncpyz(g_modDir, argv[i+1], sizeof(g_modDir)); G_AddPath(argv[i+1]); i++; } diff --git a/polymer/eduke32/source/game.h b/polymer/eduke32/source/game.h index 46d7639bf..3322fe037 100644 --- a/polymer/eduke32/source/game.h +++ b/polymer/eduke32/source/game.h @@ -191,7 +191,6 @@ extern char boardfilename[BMAX_PATH]; extern const char *defaultrtsfilename[GAMECOUNT]; extern const char *G_DefaultRtsFile(void); -extern char g_modDir[BMAX_PATH]; extern char g_modDir[BMAX_PATH]; extern char inputloc; extern char ror_protectedsectors[MAXSECTORS]; diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 380497be2..6d6bb93ee 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5119,6 +5119,7 @@ repeatcase: continue; } + // XXX Bstrcpy(temp,tempbuf); CONFIG_WriteSetup(1); if (g_modDir[0] != '/') diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 1f84d76dd..cfca9e446 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -329,9 +329,9 @@ int32_t G_SavePlayer(int32_t spot) fil = fopen(temp, "wb"); if (!fil) { - return -1; OSD_Printf("G_SavePlayer: failed opening \"%s\" for writing: %s\n", temp, strerror(errno)); + return -1; } }