aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dep/CascLib/src/CascFiles.cpp')
-rw-r--r--dep/CascLib/src/CascFiles.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/dep/CascLib/src/CascFiles.cpp b/dep/CascLib/src/CascFiles.cpp
index 0641b315a09..8c869148d6a 100644
--- a/dep/CascLib/src/CascFiles.cpp
+++ b/dep/CascLib/src/CascFiles.cpp
@@ -522,14 +522,16 @@ static int ParseFile_BuildInfo(TCascStorage * hs, void * pvListFile)
QUERY_KEY TagString = {NULL, 0};
QUERY_KEY CdnHost = {NULL, 0};
QUERY_KEY CdnPath = {NULL, 0};
- char szOneLine1[0x200];
- char szOneLine2[0x400];
+ const char * szLinePtr1;
+ const char * szLineEnd1;
+ const char * szLinePtr2;
+ const char * szLineEnd2;
size_t nLength1;
size_t nLength2;
int nError = ERROR_BAD_FORMAT;
// Extract the first line, cotaining the headers
- nLength1 = ListFile_GetNextLine(pvListFile, szOneLine1, _maxchars(szOneLine1));
+ nLength1 = ListFile_GetNextLine(pvListFile, &szLinePtr1, &szLineEnd1);
if(nLength1 == 0)
return ERROR_BAD_FORMAT;
@@ -537,16 +539,10 @@ static int ParseFile_BuildInfo(TCascStorage * hs, void * pvListFile)
// with "Active" set to 1
for(;;)
{
- const char * szLinePtr1 = szOneLine1;
- const char * szLineEnd1 = szOneLine1 + nLength1;
- const char * szLinePtr2 = szOneLine2;
- const char * szLineEnd2;
-
// Read the next line
- nLength2 = ListFile_GetNextLine(pvListFile, szOneLine2, _maxchars(szOneLine2));
+ nLength2 = ListFile_GetNextLine(pvListFile, &szLinePtr2, &szLineEnd2);
if(nLength2 == 0)
break;
- szLineEnd2 = szLinePtr2 + nLength2;
// Parse all variables
while(szLinePtr1 < szLineEnd1)
@@ -920,7 +916,7 @@ int CheckGameDirectory(TCascStorage * hs, TCHAR * szDirectory)
if(szBuildFile != NULL)
{
// Attempt to open the file
- pStream = FileStream_OpenFile(szBuildFile, 0);
+ pStream = FileStream_OpenFile(szBuildFile, STREAM_FLAG_READ_ONLY);
if(pStream != NULL)
{
// Free the stream