Browse code

Remove warning on FreeBSD4.11

git-svn: trunk@2863

Nigel Horne authored on 2007/02/25 09:43:49
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Feb 24 22:47:28 GMT 2007 (njh)
2
+----------------------------------
3
+  * libclamav/pdf.c:	Remove warning on FreeBSD4.11
4
+
1 5
 Sat Feb 24 19:40:01 CET 2007 (tk)
2 6
 ---------------------------------
3 7
   * clamscan, clamdscan, clamconf: compile with CL_NOTHREADS defined
... ...
@@ -21,13 +21,6 @@ static	char	const	rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $";
21 21
 #include "clamav-config.h"
22 22
 #endif
23 23
 
24
-#include "clamav.h"
25
-#include "others.h"
26
-
27
-#if HAVE_SYS_MMAN_H
28
-#include <sys/mman.h>
29
-#endif
30
-
31 24
 #if HAVE_MMAP
32 25
 #include <stdio.h>
33 26
 #include <sys/types.h>
... ...
@@ -36,8 +29,14 @@ static	char	const	rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $";
36 36
 #include <string.h>
37 37
 #include <fcntl.h>
38 38
 #include <stdlib.h>
39
-#include <limits.h>
40 39
 #include <errno.h>
40
+#ifdef	HAVE_LIMITS_H
41
+#include <limits.h>
42
+#endif
43
+
44
+#ifdef HAVE_SYS_MMAN_H
45
+#include <sys/mman.h>
46
+#endif
41 47
 
42 48
 #ifdef HAVE_ZLIB_H
43 49
 #include <zlib.h>
... ...
@@ -47,6 +46,8 @@ static	char	const	rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $";
47 47
 #include <io.h>
48 48
 #endif
49 49
 
50
+#include "clamav.h"
51
+#include "others.h"
50 52
 #include "mbox.h"
51 53
 #include "pdf.h"
52 54
 
... ...
@@ -397,7 +398,7 @@ flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
397 397
 	z_stream stream;
398 398
 	unsigned char output[BUFSIZ];
399 399
 
400
-	cli_dbgmsg("cli_pdf: flatedecode %lu bytes\n", len);
400
+	cli_dbgmsg("cli_pdf: flatedecode %lu bytes\n", (unsigned long)len);
401 401
 
402 402
 	stream.zalloc = (alloc_func)Z_NULL;
403 403
 	stream.zfree = (free_func)Z_NULL;
... ...
@@ -426,7 +427,8 @@ flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
426 426
 					if(ctx->limits &&
427 427
 					   ctx->limits->maxfilesize &&
428 428
 					   (nbytes > (off_t) ctx->limits->maxfilesize)) {
429
-						cli_dbgmsg("cli_pdf: flatedecode size exceeded (%lu)\n", nbytes);
429
+						cli_dbgmsg("cli_pdf: flatedecode size exceeded (%lu)\n",
430
+							(unsigned long)nbytes);
430 431
 						inflateEnd(&stream);
431 432
 						*ctx->virname = "PDF.ExceededFileSize";
432 433
 						return Z_DATA_ERROR;
... ...
@@ -440,10 +442,11 @@ flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
440 440
 			default:
441 441
 				if(stream.msg)
442 442
 					cli_warnmsg("pdf: after writing %lu bytes, got error \"%s\" inflating PDF attachment\n",
443
-						nbytes, stream.msg);
443
+						(unsigned long)nbytes,
444
+						stream.msg);
444 445
 				else
445 446
 					cli_warnmsg("pdf: after writing %lu bytes, got error %d inflating PDF attachment\n",
446
-						nbytes, zstat);
447
+						(unsigned long)nbytes, zstat);
447 448
 				inflateEnd(&stream);
448 449
 				return zstat;
449 450
 		}
... ...
@@ -489,7 +492,7 @@ ascii85decode(const char *buf, off_t len, unsigned char *output)
489 489
 
490 490
 	ptr = buf;
491 491
 
492
-	cli_dbgmsg("cli_pdf: ascii85decode %lu bytes\n", len);
492
+	cli_dbgmsg("cli_pdf: ascii85decode %lu bytes\n", (unsigned long)len);
493 493
 
494 494
 	while(len > 0) {
495 495
 		int byte = (len--) ? (int)*ptr++ : EOF;