#cmcfixes65: #i106455# fix fortify warnings
This commit is contained in:
parent
79715a469a
commit
11b01f3d7e
2 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue