diff options
author | Roger Dingledine <arma@torproject.org> | 2004-10-13 04:44:37 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-10-13 04:44:37 +0000 |
commit | a1041154ebd5b60a88ca0f9cd104b8719faa936f (patch) | |
tree | 87294ee27726114baf04d98ab8c7819f33d568e6 /src/or/dirserv.c | |
parent | 9dc72de41fac6b86c7d5cbcef862c9526437d5e9 (diff) | |
download | tor-a1041154ebd5b60a88ca0f9cd104b8719faa936f.tar tor-a1041154ebd5b60a88ca0f9cd104b8719faa936f.tar.gz |
fix const char * vs char * issue
plus unshadow some variables
svn:r2460
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 5f0e1d084..3f2032822 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -466,6 +466,8 @@ list_running_servers(char **nicknames_out) int i; int length; smartlist_t *nicknames_up, *nicknames_down; + char *name; + const char *s; *nicknames_out = NULL; nicknames_up = smartlist_create(); @@ -474,13 +476,12 @@ list_running_servers(char **nicknames_out) get_connection_array(&connection_array, &n_conns); for (i = 0; i<n_conns; ++i) { - char *name, *cp; conn = connection_array[i]; if (conn->type != CONN_TYPE_OR || !conn->nickname) continue; /* only list ORs. */ - cp = dirserv_get_nickname_by_digest(conn->identity_digest); - if (cp) { - name = tor_strdup(cp); + s = dirserv_get_nickname_by_digest(conn->identity_digest); + if (s) { + name = tor_strdup(s); } else { name = tor_malloc(HEX_DIGEST_LEN+2); *name = '$'; |