fixed check free space for the portable version in windows

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2986 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-05-23 23:53:17 +00:00
parent b4a4ce07af
commit 98c99172c0

View File

@ -61,9 +61,15 @@ bool RsDiscSpace::crossSystemDiskStats(const char *file, uint32_t& free_blocks,
szDrive[1] = file[1] ;
szDrive[2] = file[2] ;
#else
char szDrive[4];
char szDrive[4] = "";
memcpy (szDrive, file, 3);
char *pszFullPath = _fullpath (NULL, file, 0);
if (pszFullPath == 0) {
std::cerr << "Size estimate failed for drive (_fullpath) " << szDrive << std::endl ;
return false;
}
_splitpath (pszFullPath, szDrive, NULL, NULL, NULL);
free (pszFullPath);
#endif
szDrive[3] = 0;