aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-16 22:15:14 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-16 22:15:14 +0000
commitb837191fd0e897cbc5fc33874190bab8bbb83268 (patch)
tree96b7bf77047a1873c56931c4f1387cd3c36f79c8 /src/or/control.c
parente043b86f47185e0d9df53dab12d42e46c8c35b83 (diff)
downloadtor-b837191fd0e897cbc5fc33874190bab8bbb83268.tar
tor-b837191fd0e897cbc5fc33874190bab8bbb83268.tar.gz
r12768@catbus: nickm | 2007-05-16 17:25:33 -0400
Fix GCC warnings related to local parameters/variables getting shadowed. svn:r10198
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 5100c1686..0fbcb5eab 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1685,7 +1685,6 @@ handle_control_getinfo(control_connection_t *conn, uint32_t len,
}
});
if (smartlist_len(unrecognized)) {
- int i;
for (i=0; i < smartlist_len(unrecognized)-1; ++i)
connection_printf_to_buf(conn,
"552-Unrecognized key \"%s\"\r\n",
@@ -1705,10 +1704,10 @@ handle_control_getinfo(control_connection_t *conn, uint32_t len,
connection_write_str_to_buf("\r\n", conn);
} else {
char *esc = NULL;
- size_t len;
- len = write_escaped_data(v, strlen(v), 1, &esc);
+ size_t esc_len;
+ esc_len = write_escaped_data(v, strlen(v), 1, &esc);
connection_printf_to_buf(conn, "250+%s=\r\n", k);
- connection_write_to_buf(esc, len, TO_CONN(conn));
+ connection_write_to_buf(esc, esc_len, TO_CONN(conn));
tor_free(esc);
}
}
@@ -2051,12 +2050,12 @@ handle_control_postdescriptor(control_connection_t *conn, uint32_t len,
if (get_purpose(&purp, 0, &purpose) < 0) {
connection_printf_to_buf(conn, "552 Unknown purpose \"%s\"\r\n",
purp);
- SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
+ SMARTLIST_FOREACH(args, char *, arg, tor_free(arg));
smartlist_free(args);
return 0;
}
}
- SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
+ SMARTLIST_FOREACH(args, char *, arg, tor_free(arg));
smartlist_free(args);
read_escaped_data(cp, len-(cp-body), 1, &desc);
@@ -2974,9 +2973,9 @@ control_event_descriptors_changed(smartlist_t *routers)
}
if (EVENT_IS_INTERESTING1S(EVENT_NEW_DESC)) {
char *ids = smartlist_join_strings(identities, " ", 0, &len);
- size_t len = strlen(ids)+32;
- msg = tor_malloc(len);
- tor_snprintf(msg, len, "650 NEWDESC %s\r\n", ids);
+ size_t ids_len = strlen(ids)+32;
+ msg = tor_malloc(ids_len);
+ tor_snprintf(msg, ids_len, "650 NEWDESC %s\r\n", ids);
send_control_event_string(EVENT_NEW_DESC, SHORT_NAMES|ALL_FORMATS, msg);
tor_free(ids);
tor_free(msg);
@@ -2984,16 +2983,16 @@ control_event_descriptors_changed(smartlist_t *routers)
if (EVENT_IS_INTERESTING1L(EVENT_NEW_DESC)) {
smartlist_t *names = smartlist_create();
char *ids;
- size_t len;
+ size_t names_len;
SMARTLIST_FOREACH(routers, routerinfo_t *, ri, {
char *b = tor_malloc(MAX_VERBOSE_NICKNAME_LEN+1);
router_get_verbose_nickname(b, ri);
smartlist_add(names, b);
});
- ids = smartlist_join_strings(names, " ", 0, &len);
- len = strlen(ids)+32;
- msg = tor_malloc(len);
- tor_snprintf(msg, len, "650 NEWDESC %s\r\n", ids);
+ ids = smartlist_join_strings(names, " ", 0, &names_len);
+ names_len = strlen(ids)+32;
+ msg = tor_malloc(names_len);
+ tor_snprintf(msg, names_len, "650 NEWDESC %s\r\n", ids);
send_control_event_string(EVENT_NEW_DESC, LONG_NAMES|ALL_FORMATS, msg);
tor_free(ids);
tor_free(msg);