diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-15 06:14:17 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-15 06:14:17 +0000 |
commit | cc2454c803eb6b96add654fbd99f616217056396 (patch) | |
tree | 31d12ba065f57c5c195cfd962243180ec9c01ff9 /plugins/FileAsMessage/src/crc32.cpp | |
parent | b1571e501505713f1ee2aa8fed181268286d8a1d (diff) |
fixed buffer overrun
git-svn-id: http://svn.miranda-ng.org/main/trunk@13600 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FileAsMessage/src/crc32.cpp')
-rw-r--r-- | plugins/FileAsMessage/src/crc32.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/FileAsMessage/src/crc32.cpp b/plugins/FileAsMessage/src/crc32.cpp index ab34393f8d..dc40c1a6fb 100644 --- a/plugins/FileAsMessage/src/crc32.cpp +++ b/plugins/FileAsMessage/src/crc32.cpp @@ -9,9 +9,9 @@ void InitCRC32() {
UINT32 r = i;
for (int j = 0; j < 8; j++)
- if (r & 1)
+ if (r & 1)
r = (r >> 1) ^ CRCPoly;
- else
+ else
r >>= 1;
CRC32Table[i] = r;
}
@@ -21,11 +21,11 @@ const ulong INITCRC = -1L; inline ulong UpdateCRC32(uchar val, ulong crc)
{
- return CRC32Table[(uchar)crc^val] ^ (crc>>8);
+ return CRC32Table[(uchar)crc^val] ^ (crc >> 8);
}
-ulong memcrc32(uchar *ptr, int size, ulong crc )
+ulong memcrc32(uchar *ptr, int size, ulong crc)
{
- while(size--) crc = UpdateCRC32(*ptr++, crc);
+ while (size--) crc = UpdateCRC32(*ptr++, crc);
return crc;
}
|