From 0665d961d2dbf7f243be8882dddf9c9ccdba404e Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 5 Sep 2012 17:25:40 +0000 Subject: [PATCH] Use Bstrncpyz in 1 place; fix displaying err msg if write-opening savegame fails git-svn-id: https://svn.eduke32.com/eduke32@2998 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 2 +- polymer/eduke32/source/game.h | 1 - polymer/eduke32/source/gamedef.c | 1 + polymer/eduke32/source/savegame.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) 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; } }