Fix compilation on linux

This commit is contained in:
nukeykt 2019-07-28 18:20:25 +09:00 committed by Christoph Oelckers
parent e6ffc816c9
commit 6fea4bf527
2 changed files with 10 additions and 10 deletions

View file

@ -468,16 +468,16 @@ static char* KeyValues_FindKeyValue(char **vdfbuf, char * const vdfbufend, const
static void G_ParseSteamKeyValuesForPaths(const char *vdf)
{
int32_t fd = Bopen(vdf, BO_RDONLY);
int32_t size = Bfilelength(fd);
buildvfs_fd fd = buildvfs_open_read(vdf);
int32_t size = buildvfs_length(fd);
char *vdfbufstart, *vdfbuf, *vdfbufend;
if (size <= 0)
return;
vdfbufstart = vdfbuf = (char*)Xmalloc(size);
size = (int32_t)Bread(fd, vdfbuf, size);
Bclose(fd);
size = (int32_t)buildvfs_read(fd, vdfbuf, size);
buildvfs_close(fd);
vdfbufend = vdfbuf + size;
if (KeyValues_FindParentKey(&vdfbuf, vdfbufend, "LibraryFolders"))
@ -488,7 +488,7 @@ static void G_ParseSteamKeyValuesForPaths(const char *vdf)
G_AddSteamPaths(result);
}
Bfree(vdfbufstart);
Xfree(vdfbufstart);
}
#endif
#endif

View file

@ -696,16 +696,16 @@ static char* KeyValues_FindKeyValue(char **vdfbuf, char * const vdfbufend, const
static void G_ParseSteamKeyValuesForPaths(const char *vdf)
{
int32_t fd = Bopen(vdf, BO_RDONLY);
int32_t size = Bfilelength(fd);
buildvfs_fd fd = buildvfs_open_read(vdf);
int32_t size = buildvfs_length(fd);
char *vdfbufstart, *vdfbuf, *vdfbufend;
if (size <= 0)
return;
vdfbufstart = vdfbuf = (char*)Xmalloc(size);
size = (int32_t)Bread(fd, vdfbuf, size);
Bclose(fd);
size = (int32_t)buildvfs_read(fd, vdfbuf, size);
buildvfs_close(fd);
vdfbufend = vdfbuf + size;
if (KeyValues_FindParentKey(&vdfbuf, vdfbufend, "LibraryFolders"))
@ -716,7 +716,7 @@ static void G_ParseSteamKeyValuesForPaths(const char *vdf)
G_AddSteamPaths(result);
}
Bfree(vdfbufstart);
Xfree(vdfbufstart);
}
#endif
#endif