[or-cvs] cosmetic fixes
arma at seul.org
arma at seul.org
Mon Jul 18 23:33:21 UTC 2005
Update of /home2/or/cvsroot/tor/src/common
In directory moria:/home/arma/work/onion/cvs/tor/src/common
Modified Files:
container.c
Log Message:
cosmetic fixes
Index: container.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/common/container.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- container.c 18 Jul 2005 23:16:09 -0000 1.30
+++ container.c 18 Jul 2005 23:33:19 -0000 1.31
@@ -358,14 +358,14 @@
tor_assert(sl);
tor_assert(join);
- if (sl->num_used == 0)
- n = join_len; /* special-case this one, to avoid underflow */
+ if (terminate)
+ n = join_len;
for (i = 0; i < sl->num_used; ++i) {
n += strlen(sl->list[i]);
- n += join_len;
+ if (i+1 < sl->num_used) /* avoid double-counting the last one */
+ n += join_len;
}
- if (!terminate) n -= join_len;
dst = r = tor_malloc(n+1);
for (i = 0; i < sl->num_used; ) {
for (src = sl->list[i]; *src; )
More information about the tor-commits
mailing list