Browse code

make endian conversion macros work when operand is negative number.

git-svn: trunk@3355

Török Edvin authored on 2007/11/03 08:26:30
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sat Nov  3 00:25:52 EET 2007 (edwin)
2
+------------------------------------
3
+  * libclamav/ole2_extract.c: make endian conversion macros work when operand
4
+  is negative number.
5
+
1 6
 Fri Nov  2 00:16:27 CET 2007 (acab)
2 7
   * libclamav/autoit: final
3 8
 
... ...
@@ -52,8 +52,8 @@
52 52
 #include "mbox.h"
53 53
 #include "blob.h" /* sanitiseName() */
54 54
 
55
-#define ole2_endian_convert_16(v) le16_to_host(v)
56
-#define ole2_endian_convert_32(v) le32_to_host(v)
55
+#define ole2_endian_convert_16(v) le16_to_host((uint16_t)(v))
56
+#define ole2_endian_convert_32(v) le32_to_host((uint32_t)(v))
57 57
 
58 58
 #ifndef HAVE_ATTRIB_PACKED
59 59
 #define __attribute__(x)