Browse code

warnings in pdf and tar

git-svn: trunk@3632

aCaB authored on 2008/02/15 00:38:59
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Feb 14 16:25:11 CET 2008 (acab)
2
+-----------------------------------
3
+  * libclamav: fix warnings in pdf and untar
4
+
1 5
 Thu Feb 14 15:33:22 CET 2008 (acab)
2 6
 -----------------------------------
3 7
   * libclamav/untar: OTF scan
... ...
@@ -66,8 +66,8 @@ static	char	const	rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $";
66 66
 /*#define	SAVE_TMP	/* Save the file being worked on in tmp */
67 67
 #endif
68 68
 
69
-static	int	try_flatedecode(unsigned char *buf, off_t real_len, off_t calculated_len, int fout, const cli_ctx *ctx);
70
-static	int	flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx);
69
+static	int	try_flatedecode(unsigned char *buf, off_t real_len, off_t calculated_len, int fout, cli_ctx *ctx);
70
+static	int	flatedecode(unsigned char *buf, off_t len, int fout, cli_ctx *ctx);
71 71
 static	int	ascii85decode(const char *buf, off_t len, unsigned char *output);
72 72
 static	const	char	*pdf_nextlinestart(const char *ptr, size_t len);
73 73
 static	const	char	*pdf_nextobject(const char *ptr, size_t len);
... ...
@@ -460,7 +460,7 @@ cli_pdf(const char *dir, int desc, cli_ctx *ctx)
460 460
 				if(is_flatedecode)
461 461
 					rc = try_flatedecode((unsigned char *)tmpbuf, real_streamlen, real_streamlen, fout, ctx);
462 462
 				else
463
-				       	rc = cli_writen(fout, (const char *)streamstart, real_streamlen)==real_streamlen ? CL_CLEAN : CL_EIO;
463
+				  rc = (unsigned long)cli_writen(fout, (const char *)streamstart, real_streamlen)==real_streamlen ? CL_CLEAN : CL_EIO;
464 464
 			}
465 465
 			free(tmpbuf);
466 466
 		} else if(is_flatedecode) {
... ...
@@ -470,7 +470,7 @@ cli_pdf(const char *dir, int desc, cli_ctx *ctx)
470 470
 			cli_dbgmsg("cli_pdf: writing %lu bytes from the stream\n",
471 471
 				(unsigned long)real_streamlen);
472 472
 			if((rc = cli_checklimits("cli_pdf", ctx, real_streamlen, 0, 0))==CL_CLEAN)
473
-				rc = cli_writen(fout, (const char *)streamstart, real_streamlen) == real_streamlen ? CL_CLEAN : CL_EIO;
473
+				rc = (unsigned long)cli_writen(fout, (const char *)streamstart, real_streamlen) == real_streamlen ? CL_CLEAN : CL_EIO;
474 474
 		}
475 475
 
476 476
 		if (rc == CL_CLEAN) {
... ...
@@ -510,7 +510,7 @@ cli_pdf(const char *dir, int desc, cli_ctx *ctx)
510 510
  * flate inflation - returns clamAV status, e.g CL_SUCCESS, CL_EZIP
511 511
  */
512 512
 static int
513
-try_flatedecode(unsigned char *buf, off_t real_len, off_t calculated_len, int fout, const cli_ctx *ctx)
513
+try_flatedecode(unsigned char *buf, off_t real_len, off_t calculated_len, int fout, cli_ctx *ctx)
514 514
 {
515 515
 	int ret = cli_checklimits("cli_pdf", ctx, real_len, 0, 0);
516 516
 
... ...
@@ -539,7 +539,7 @@ try_flatedecode(unsigned char *buf, off_t real_len, off_t calculated_len, int fo
539 539
 }
540 540
 
541 541
 static int
542
-flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
542
+flatedecode(unsigned char *buf, off_t len, int fout, cli_ctx *ctx)
543 543
 {
544 544
 	int zstat, ret;
545 545
 	off_t nbytes;
... ...
@@ -43,6 +43,7 @@ static	char	const	rcsid[] = "$Id: untar.c,v 1.35 2007/02/12 20:46:09 njh Exp $";
43 43
 #include "untar.h"
44 44
 #include "mbox.h"
45 45
 #include "blob.h"
46
+#include "scanners.h"
46 47
 
47 48
 #define BLOCKSIZE 512
48 49