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
This commit is contained in:
helixhorned 2012-09-05 17:25:40 +00:00
parent bb5d3496ee
commit 0665d961d2
4 changed files with 3 additions and 3 deletions

View file

@ -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++;
}

View file

@ -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];

View file

@ -5119,6 +5119,7 @@ repeatcase:
continue;
}
// XXX
Bstrcpy(temp,tempbuf);
CONFIG_WriteSetup(1);
if (g_modDir[0] != '/')

View file

@ -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;
}
}