Fix a couple of issues around std::string.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2019-09-07 18:51:07 +01:00
parent dced4793b7
commit be476f9a9c
3 changed files with 3 additions and 3 deletions

View File

@ -483,7 +483,7 @@ void GetProgramDirectory(void)
{ {
if ((g_sProgramDir[loop] == TEXT('\\')) || (g_sProgramDir[loop] == TEXT(':'))) if ((g_sProgramDir[loop] == TEXT('\\')) || (g_sProgramDir[loop] == TEXT(':')))
{ {
g_sProgramDir.resize(loop); // this reduces the size g_sProgramDir.resize(loop + 1); // this reduces the size
break; break;
} }
} }

View File

@ -2024,7 +2024,7 @@ Update_t CmdTraceFile (int nArgs)
} }
else else
{ {
std::string sFileName;; std::string sFileName;
if (nArgs) if (nArgs)
sFileName = g_aArgs[1].sArg; sFileName = g_aArgs[1].sArg;

View File

@ -49,7 +49,7 @@ ImageError_e ImageOpen( const std::string & pszImageFilename,
if (bExpectFloppy && sg_DiskImageHelper.GetWorkBuffer() == NULL) if (bExpectFloppy && sg_DiskImageHelper.GetWorkBuffer() == NULL)
return eIMAGE_ERROR_BAD_POINTER; return eIMAGE_ERROR_BAD_POINTER;
if (! (ppImageInfo && pWriteProtected)) if (!(!pszImageFilename.empty() && ppImageInfo && pWriteProtected))
return eIMAGE_ERROR_BAD_POINTER; return eIMAGE_ERROR_BAD_POINTER;
// CREATE A RECORD FOR THE FILE // CREATE A RECORD FOR THE FILE