[prev in list] [next in list] [prev in thread] [next in thread]
List: privoxy-commits
Subject: [privoxy-commits] current parsers.c,1.211,1.212
From: noreply () sourceforge ! net
Date: 2010-06-13 12:25:35
Message-ID: E1ONmFr-0005EI-IR () sfp-cvsdas-4 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Update of /cvsroot/ijbswa/current
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20097
Modified Files:
parsers.c
Log Message:
In add_to_iob(), limit the scope of the variable 'want' and turn an interestingly \
looking for loop into a boring while loop.
Index: parsers.c
===================================================================
RCS file: /cvsroot/ijbswa/current/parsers.c,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -d -r1.211 -r1.212
--- parsers.c 1 May 2010 18:20:50 -0000 1.211
+++ parsers.c 13 Jun 2010 12:25:33 -0000 1.212
@@ -318,7 +318,7 @@
jb_err add_to_iob(struct client_state *csp, char *buf, long n)
{
struct iob *iob = csp->iob;
- size_t used, offset, need, want;
+ size_t used, offset, need;
char *p;
if (n <= 0) return JB_ERR_OK;
@@ -341,7 +341,12 @@
if (need > iob->size)
{
- for (want = csp->iob->size ? csp->iob->size : 512; want <= need;) want *= 2;
+ size_t want = csp->iob->size ? csp->iob->size : 512;
+
+ while (want <= need)
+ {
+ want *= 2;
+ }
if (want <= csp->config->buffer_limit && NULL != (p = (char \
*)realloc(iob->buf, want))) {
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
ijbswa-commits mailing list
ijbswa-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ijbswa-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic