Browse code

make rar stfu - bb#1835

aCaB authored on 2010/03/02 03:04:06
Showing 1 changed files
... ...
@@ -15,6 +15,12 @@
15 15
 
16 16
 #include "libclamunrar/unrarhlp.h"
17 17
 
18
+#ifdef RAR_HIGH_DEBUG
19
+#define rar_dbgmsg printf
20
+#else
21
+static void rar_dbgmsg(const char* fmt,...){}
22
+#endif
23
+
18 24
 #define RAR_MAX_ALLOCATION 184549376
19 25
 
20 26
 void *rar_malloc(size_t size)
... ...
@@ -23,7 +29,7 @@ void *rar_malloc(size_t size)
23 23
 
24 24
 
25 25
     if(!size || size > RAR_MAX_ALLOCATION) {
26
-	fprintf(stderr, "UNRAR: rar_malloc(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", size);
26
+	rar_dbgmsg("UNRAR: rar_malloc(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", size);
27 27
 	return NULL;
28 28
     }
29 29
 
... ...
@@ -41,7 +47,7 @@ void *rar_realloc2(void *ptr, size_t size)
41 41
 
42 42
 
43 43
     if(!size || size > RAR_MAX_ALLOCATION) {
44
-	fprintf(stderr, "UNRAR: rar_realloc2(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", size);
44
+	rar_dbgmsg("UNRAR: rar_realloc2(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", size);
45 45
 	return NULL;
46 46
     }
47 47