From: Fabian Keil Date: Wed, 3 Jan 2007 14:39:19 +0000 (+0000) Subject: Fix a gcc43 warning and mark the binbuffer X-Git-Tag: v_3_0_7~406 X-Git-Url: http://www.privoxy.org/gitweb/introduction.html?a=commitdiff_plain;h=51ed869832968bce561de8957ec0e925f02a3ac2;p=privoxy.git Fix a gcc43 warning and mark the binbuffer as immutable for buf_getbyte(). --- diff --git a/deanimate.c b/deanimate.c index b9592e8f..278c366a 100644 --- a/deanimate.c +++ b/deanimate.c @@ -1,7 +1,7 @@ -const char deanimate_rcs[] = "$Id: deanimate.c,v 1.12.2.1 2004/10/03 12:53:32 david__schmidt Exp $"; +const char deanimate_rcs[] = "$Id: deanimate.c,v 1.14 2006/07/18 14:48:45 david__schmidt Exp $"; /********************************************************************* * - * File : $Source: /cvsroot/ijbswa/current/Attic/deanimate.c,v $ + * File : $Source: /cvsroot/ijbswa/current/deanimate.c,v $ * * Purpose : Declares functions to manipulate binary images on the * fly. High-level functions include: @@ -12,7 +12,7 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.12.2.1 2004/10/03 12:53:32 da * buf_copy, buf_getbyte, gif_skip_data_block, * gif_extract_image and jpeg_inspect * - * Copyright : Written by and Copyright (C) 2001 - 2004 by the the + * Copyright : Written by and Copyright (C) 2001 - 2004, 2006 by the * SourceForge Privoxy team. http://www.privoxy.org/ * * Based on the GIF file format specification (see @@ -40,6 +40,10 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.12.2.1 2004/10/03 12:53:32 da * * Revisions : * $Log: deanimate.c,v $ + * Revision 1.14 2006/07/18 14:48:45 david__schmidt + * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) + * with what was really the latest development (the v_3_0_branch branch) + * * Revision 1.12.2.1 2004/10/03 12:53:32 david__schmidt * Add the ability to check jpeg images for invalid * lengths of comment blocks. Defensive strategy @@ -232,7 +236,7 @@ int buf_copy(struct binbuffer *src, struct binbuffer *dst, size_t length) * Returns : The byte on success, or 0 on failiure * *********************************************************************/ -unsigned char buf_getbyte(struct binbuffer *src, size_t offset) +unsigned char buf_getbyte(const struct binbuffer *src, size_t offset) { if (src->offset + offset < src->size) { @@ -272,7 +276,8 @@ int gif_skip_data_block(struct binbuffer *buf) */ while((c = buf_getbyte(buf, 0)) != '\0') { - if ((buf->offset += c + 1) >= buf->size - 1) + buf->offset += (size_t)c + 1; + if (buf->offset >= buf->size - 1) { return 1; }