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