]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/crc32.c
Fix typo in buffer sizes off by factor of 10
[bacula/bacula] / bacula / src / lib / crc32.c
index 7c1c890339f960d5224c04b36f8a2f5c2bc354b8..847b1404f23de1d1415a9f011cb7cd16fd71a74b 100644 (file)
@@ -360,7 +360,7 @@ tole(0xccb0a91fL), tole(0x740cce7aL), tole(0x66b96194L), tole(0xde0506f1L)},
  */
 uint32_t bcrc32(unsigned char*buf, int len)
 {
-# ifdef __LITTLE_ENDIAN
+# ifdef HAVE_LITTLE_ENDIAN
 #  define DO_CRC(x) crc = tab[0][(crc ^ (x)) & 255 ] ^ (crc >> 8)
 #  define DO_CRC4 crc = tab[3][(crc) & 255 ] ^ \
                 tab[2][(crc >> 8) & 255 ] ^ \
@@ -378,10 +378,10 @@ uint32_t bcrc32(unsigned char*buf, int len)
         uint32_t crc = tole(~0);
 
         /* Align it */
-        if ((long)buf & 3 && len) {
+        if ((intptr_t)buf & 3 && len) {
                 do {
                         DO_CRC(*buf++);
-                } while ((--len) && ((long)buf)&3);
+                } while ((--len) && ((intptr_t)buf)&3);
         }
         rem_len = len & 3;
         /* load data 32 bits wide, xor data 32 bits wide. */