[or-cvs] fix const char * vs char * issue

Roger Dingledine arma at seul.org
Wed Oct 13 04:44:39 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	dirserv.c 
Log Message:
fix const char * vs char * issue
plus unshadow some variables


Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dirserv.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- dirserv.c	13 Oct 2004 01:13:37 -0000	1.93
+++ dirserv.c	13 Oct 2004 04:44:37 -0000	1.94
@@ -466,6 +466,8 @@
   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 @@
 
   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 = '$';



More information about the tor-commits mailing list