Files
MINGW-packages/mingw-w64-tidyhtml/mappedio_sizecheck.patch
2014-08-13 22:09:15 +03:00

31 lines
935 B
Diff

--- tidy/src/mappedio.c.orig 2008-03-18 23:19:35.000000000 +0300
+++ tidy/src/mappedio.c 2014-08-13 20:49:36.108750200 +0300
@@ -192,25 +192,16 @@
fin = (MappedFileSource*) TidyAlloc( allocator, sizeof(MappedFileSource) );
if ( !fin )
return -1;
-
-#if _MSC_VER < 1300 /* less than msvc++ 7.0 */
+
{
LARGE_INTEGER* pli = (LARGE_INTEGER *)&fin->size;
- (DWORD)pli->LowPart = GetFileSize( fp, (DWORD *)&pli->HighPart );
+ pli->LowPart = GetFileSize( fp, (DWORD *)&pli->HighPart );
if ( GetLastError() != NO_ERROR || fin->size <= 0 )
{
TidyFree(allocator, fin);
return -1;
}
}
-#else
- if ( !GetFileSizeEx( fp, (LARGE_INTEGER*)&fin->size )
- || fin->size <= 0 )
- {
- TidyFree(allocator, fin);
- return -1;
- }
-#endif
fin->map = CreateFileMapping( fp, NULL, PAGE_READONLY, 0, 0, NULL );