aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascFiles.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-12-05 17:41:27 +0100
committerShauren <shauren.trinity@gmail.com>2016-12-05 17:41:27 +0100
commitc856a058b50e9f9844a4eb4b63e3786de69e6678 (patch)
treea24d90a382882fdaeb563e99a34b9b0c11f901d6 /dep/CascLib/src/CascFiles.cpp
parentfcbbeb3644c2f19f6c074871e1cb47c7fb8876c0 (diff)
Dep: Update CascLib to ladislav-zezula/CascLib@e2fc95cdb15d03eb1e4c86b1161df82d5b92eff9
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