From: ShadowFlare Date: Wed, 15 Aug 2012 07:48:29 +0000 (-0600) Subject: Use a separate int variable here to fix this warning. X-Git-Url: https://sfsrealm.hopto.org/projects/?a=commitdiff_plain;h=655bd6bcdb58f9d05b03babeaf5d155570f27c92;p=SFmpqapi.git Use a separate int variable here to fix this warning. --- diff --git a/SFmpqapi.cpp b/SFmpqapi.cpp index e527cda..7b22014 100644 --- a/SFmpqapi.cpp +++ b/SFmpqapi.cpp @@ -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;