diff options
author | Ladislav Zezula <ladislav.zezula@avg.com> | 2015-05-28 13:49:23 +0200 |
---|---|---|
committer | Ladislav Zezula <ladislav.zezula@avg.com> | 2015-05-28 13:49:23 +0200 |
commit | 1b38ceb0d4bb4ae32cb93c295e3ef493b91f9a78 (patch) | |
tree | 5634e1d3fd17386975db1c0d4e95176db098bc1f /src/SFileFindFile.cpp | |
parent | c26e12c79f2a5e0c092de4a62565bdae4bf5a7dd (diff) |
+ Fixed defects found by Coverity (well, most of them)
Diffstat (limited to 'src/SFileFindFile.cpp')
-rw-r--r-- | src/SFileFindFile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/SFileFindFile.cpp b/src/SFileFindFile.cpp index 3d6c74e..3e6854b 100644 --- a/src/SFileFindFile.cpp +++ b/src/SFileFindFile.cpp @@ -185,7 +185,7 @@ static TFileEntry * FindPatchEntry(TMPQArchive * ha, TFileEntry * pFileEntry) { TFileEntry * pPatchEntry = NULL; TFileEntry * pTempEntry; - char szFileName[MAX_PATH]; + char szFileName[MAX_PATH+1]; // Go while there are patches while(ha->haPatch != NULL) @@ -196,8 +196,8 @@ static TFileEntry * FindPatchEntry(TMPQArchive * ha, TFileEntry * pFileEntry) // Prepare the prefix for the file name if(ha->pPatchPrefix != NULL) - strcpy(szFileName, ha->pPatchPrefix->szPatchPrefix); - strcat(szFileName, pFileEntry->szFileName); + StringCopyA(szFileName, ha->pPatchPrefix->szPatchPrefix, MAX_PATH); + StringCatA(szFileName, pFileEntry->szFileName, MAX_PATH); // Try to find the file there pTempEntry = GetFileEntryExact(ha, szFileName, 0, NULL); @@ -280,7 +280,7 @@ static bool DoMPQSearch_FileEntry( } // Fill the file name and plain file name - strcpy(lpFindFileData->cFileName, szFileName + nPrefixLength); + StringCopyA(lpFindFileData->cFileName, szFileName + nPrefixLength, MAX_PATH-1); lpFindFileData->szPlainName = (char *)GetPlainFileName(lpFindFileData->cFileName); return true; } |