Remove warning on FreeBSD4.11

git-svn: trunk@2863
remotes/push_mirror/metadata
Nigel Horne 19 years ago
parent 2ed08e8a48
commit ed6446ff91
  1. 4
      ChangeLog
  2. 29
      libclamav/pdf.c

@ -1,3 +1,7 @@
Sat Feb 24 22:47:28 GMT 2007 (njh)
----------------------------------
* libclamav/pdf.c: Remove warning on FreeBSD4.11
Sat Feb 24 19:40:01 CET 2007 (tk)
---------------------------------
* 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 $";
#include "clamav-config.h"
#endif
#include "clamav.h"
#include "others.h"
#if HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#if HAVE_MMAP
#include <stdio.h>
#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 $";
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_ZLIB_H
#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 $";
#include <io.h>
#endif
#include "clamav.h"
#include "others.h"
#include "mbox.h"
#include "pdf.h"
@ -397,7 +398,7 @@ flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
z_stream stream;
unsigned char output[BUFSIZ];
cli_dbgmsg("cli_pdf: flatedecode %lu bytes\n", len);
cli_dbgmsg("cli_pdf: flatedecode %lu bytes\n", (unsigned long)len);
stream.zalloc = (alloc_func)Z_NULL;
stream.zfree = (free_func)Z_NULL;
@ -426,7 +427,8 @@ flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
if(ctx->limits &&
ctx->limits->maxfilesize &&
(nbytes > (off_t) ctx->limits->maxfilesize)) {
cli_dbgmsg("cli_pdf: flatedecode size exceeded (%lu)\n", nbytes);
cli_dbgmsg("cli_pdf: flatedecode size exceeded (%lu)\n",
(unsigned long)nbytes);
inflateEnd(&stream);
*ctx->virname = "PDF.ExceededFileSize";
return Z_DATA_ERROR;
@ -440,10 +442,11 @@ flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
default:
if(stream.msg)
cli_warnmsg("pdf: after writing %lu bytes, got error \"%s\" inflating PDF attachment\n",
nbytes, stream.msg);
(unsigned long)nbytes,
stream.msg);
else
cli_warnmsg("pdf: after writing %lu bytes, got error %d inflating PDF attachment\n",
nbytes, zstat);
(unsigned long)nbytes, zstat);
inflateEnd(&stream);
return zstat;
}
@ -489,7 +492,7 @@ ascii85decode(const char *buf, off_t len, unsigned char *output)
ptr = buf;
cli_dbgmsg("cli_pdf: ascii85decode %lu bytes\n", len);
cli_dbgmsg("cli_pdf: ascii85decode %lu bytes\n", (unsigned long)len);
while(len > 0) {
int byte = (len--) ? (int)*ptr++ : EOF;

Loading…
Cancel
Save