#cmcfixes65: #i106455# fix fortify warnings

This commit is contained in:
Caolán McNamara 2009-10-29 21:06:25 +00:00
parent 79715a469a
commit 11b01f3d7e
2 changed files with 9 additions and 4 deletions

View file

@ -46,14 +46,14 @@
namespace fixes
{
void changedir(const char* _sPath)
int changedir(const char* _sPath)
{
#if defined(WIN32)
// chdir(_sPath) is marked depricated since Visual C++ 2005
// use _chdir instead
::_chdir(_sPath);
return ::_chdir(_sPath);
#else
::chdir(_sPath);
return ::chdir(_sPath);
#endif
}
}

View file

@ -116,7 +116,12 @@ int ProcessHandler::readPIDFromFile()
// exit(0);
}
// if file exist, wait short, maybe the other tool writes it down.
fscanf(in, "%d", &nPID);
if (fscanf(in, "%d", &nPID) != 1)
{
// fprintf(stderr, "warning: (testshl.cxx) can't read own pid.\n");
return 0;
// exit(0);
}
fclose(in);
}
else