Current News
Archived News
Search News
Discussion Forum


Old Forum
Install Programs More Downloads...
Troubleshooting
Source Code
Format Specs.
Misc. Information
Non-SF Stuff
Links




ShadowFlare [Wed, 15 Aug 2012 07:48:29 +0000 (01:48 -0600)]
SFmpqapi.cpp

index e527cda..7b22014 100644 (file)
@@ -2559,13 +2559,14 @@ BOOL SFMPQAPI WINAPI MpqCompactArchive(MPQHANDLE hMPQ)
        HANDLE hFile = CreateFile(lpFileName,GENERIC_READ|GENERIC_WRITE,0,0,CREATE_NEW,0,0);
        UInt64 i;
        if (hFile==INVALID_HANDLE_VALUE) {
-               for (i=0;i<10000;i++) {
-                       sprintf(lpFileName,"%s.compact.%04d",mpqOpenArc->lpFileName,i);
+               int filenum = 0;
+               for (filenum=0;filenum<10000;filenum++) {
+                       sprintf(lpFileName,"%s.compact.%04d",mpqOpenArc->lpFileName,filenum);
 
                        hFile = CreateFile(lpFileName,GENERIC_READ|GENERIC_WRITE,0,0,CREATE_NEW,0,0);
                        if (hFile!=INVALID_HANDLE_VALUE) break;
                }
-               if (i==10000) return FALSE;
+               if (filenum==10000) return FALSE;
        }
        UInt64 qwLastOffset = mpqOpenArc->dwHeaderSize;
        DWORD tsz;