add missing arg to Crc32_FromFile function
This commit is contained in:
parent
a7b8e2e80f
commit
f9fa3b0fa2
3 changed files with 14 additions and 16 deletions
|
@ -6,6 +6,6 @@
|
|||
|
||||
|
||||
unsigned long Crc32_ComputeBuf(unsigned long inCrc32, const void* buf, size_t bufLen);
|
||||
unsigned long Crc32_FromFile(char* filename);
|
||||
unsigned long Crc32_FromFile(unsigned long crc32, char* filename);
|
||||
|
||||
#endif
|
||||
|
|
26
src/crc32.c
26
src/crc32.c
|
@ -77,28 +77,26 @@ unsigned long Crc32_ComputeBuf( unsigned long inCrc32, const void *buf,
|
|||
return( crc32 ^ 0xFFFFFFFF );
|
||||
}
|
||||
|
||||
unsigned long Crc32_FromFile(char* filename)
|
||||
unsigned long Crc32_FromFile(unsigned long crc32, char* filename)
|
||||
{
|
||||
if (!filename)
|
||||
return 0;
|
||||
|
||||
unsigned long crc32 = 0;
|
||||
|
||||
FILE* fp = fopen(filename, "rb");
|
||||
if (fp)
|
||||
if (!fp)
|
||||
return 0;
|
||||
|
||||
char buf[1024];
|
||||
for (size_t s = 0; (s = fread(buf, 1, sizeof(buf), fp)) && !ferror(fp);)
|
||||
{
|
||||
char buf[1024];
|
||||
for (size_t s = 0; (s = fread(buf, 1, sizeof(buf), fp)) && !ferror(fp);)
|
||||
{
|
||||
crc32 = Crc32_ComputeBuf(crc32, buf, s);
|
||||
}
|
||||
|
||||
if (ferror(fp))
|
||||
crc32 = 0;
|
||||
|
||||
fclose(fp);
|
||||
crc32 = Crc32_ComputeBuf(crc32, buf, s);
|
||||
}
|
||||
|
||||
if (ferror(fp))
|
||||
crc32 = 0;
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return crc32;
|
||||
}
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ void dbg_init()
|
|||
TRACE("Wine sysname = %s, release = %s\n", sysname, release);
|
||||
}
|
||||
|
||||
TRACE("crc32 = %08X\n", Crc32_FromFile(exe_path));
|
||||
TRACE("crc32 = %08X\n", Crc32_FromFile(0, exe_path));
|
||||
|
||||
DWORD timestamp = util_get_timestamp(GetModuleHandleA(NULL));
|
||||
if (timestamp)
|
||||
|
|
Loading…
Reference in a new issue