Fix usage of getcwd.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2017-05-21 14:04:24 +01:00
parent 017dc307b2
commit f625e36f5c
2 changed files with 12 additions and 3 deletions

View file

@ -99,6 +99,8 @@ void foo(int argc, const char * argv [])
g_fh = fopen("/tmp/applewin.txt", "w");
setbuf(g_fh, NULL);
LogFileOutput("Initialisation\n");
ImageInitialize();
DiskInitialize();
int nError = 0; // TODO: Show error MsgBox if we get a DiskInsert error

View file

@ -203,7 +203,6 @@ HRSRC FindResource(void *, const std::string & filename, const char *)
if (result.data.empty())
{
LogFileOutput("FindResource: could not load resource %s\n", filename.c_str());
printf("pippo\n");
}
return result;
@ -233,8 +232,16 @@ DWORD timeGetTime()
DWORD GetCurrentDirectory(DWORD length, char * buffer)
{
getcwd(buffer, length);
return 0;
const char * cwd = getcwd(buffer, length);
if (cwd)
{
return strlen(buffer);
}
else
{
return 0;
}
}
UINT64 _strtoui64(const char * str, void *, int)