Cast size_t to long, before applying the unary - operator

svn path=/trunk/; revision=22359
This commit is contained in:
Hervé Poussineau 2006-06-15 12:54:31 +00:00
parent 78fce8752c
commit 3949820944

View file

@ -340,7 +340,7 @@ RestoreFile5(
/* Update INFO2 */
/* 1) If not last entry, copy last entry to the current one */
if (SetFilePointer(bin->hInfo, -sizeof(DELETED_FILE_RECORD), NULL, FILE_END) == INVALID_SET_FILE_POINTER)
if (SetFilePointer(bin->hInfo, -(LONG)sizeof(DELETED_FILE_RECORD), NULL, FILE_END) == INVALID_SET_FILE_POINTER)
goto cleanup;
if (!ReadFile(bin->hInfo, &LastFile, sizeof(DELETED_FILE_RECORD), &bytesRead, NULL))
goto cleanup;
@ -374,7 +374,7 @@ RestoreFile5(
goto cleanup;
}
/* 3) Truncate file */
if (SetFilePointer(bin->hInfo, -sizeof(DELETED_FILE_RECORD), NULL, FILE_END) == INVALID_SET_FILE_POINTER)
if (SetFilePointer(bin->hInfo, -(LONG)sizeof(DELETED_FILE_RECORD), NULL, FILE_END) == INVALID_SET_FILE_POINTER)
goto cleanup;
if (!SetEndOfFile(bin->hInfo))
goto cleanup;