Browse code

VS2005 fix

git-svn: trunk@2230

Tomasz Kojm authored on 2006/09/03 03:59:48
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Sep  2 20:56:52 CEST 2006 (tk)
2
+----------------------------------
3
+  * libclamav/others.c: apply VS2005 fix from NJH
4
+
1 5
 Sat Sep  2 20:16:26 CEST 2006 (tk)
2 6
 ----------------------------------
3 7
   * libclamav/unrar: more bugfixes
... ...
@@ -89,6 +89,11 @@ static pthread_mutex_t cli_gentempname_mutex = PTHREAD_MUTEX_INITIALIZER;
89 89
 #define	O_BINARY	0
90 90
 #endif
91 91
 
92
+#ifdef        C_WINDOWS
93
+#undef        P_tmpdir
94
+#define       P_tmpdir        "C:\\WINDOWS\\TEMP"
95
+#endif
96
+
92 97
 #define CL_FLEVEL 8 /* don't touch it */
93 98
 
94 99
 short cli_debug_flag = 0, cli_leavetemps_flag = 0;
... ...
@@ -775,7 +780,7 @@ int cli_filecopy(const char *src, const char *dest)
775 775
 	int s, d, bytes;
776 776
 
777 777
 
778
-    if((s = open(src, O_RDONLY)) == -1)
778
+    if((s = open(src, O_RDONLY|O_BINARY)) == -1)
779 779
 	return -1;
780 780
 
781 781
     if((d = open(dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, S_IRWXU)) == -1) {