[or-cvs] don"t print nulls

Roger Dingledine arma at seul.org
Mon May 2 21:54:19 UTC 2005


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

Modified Files:
	dirserv.c 
Log Message:
don't print nulls


Index: dirserv.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- dirserv.c	2 May 2005 21:48:54 -0000	1.161
+++ dirserv.c	2 May 2005 21:54:16 -0000	1.162
@@ -338,7 +338,8 @@
   /* Okay.  Now check whether the fingerprint is recognized. */
   r = dirserv_router_fingerprint_is_known(ri);
   if (r==-1) {
-    log_fn(LOG_WARN, "Known nickname '%s', wrong fingerprint. Not adding (ContactInfo '%s').", ri->nickname, ri->contact_info);
+    log_fn(LOG_WARN, "Known nickname '%s', wrong fingerprint. Not adding (ContactInfo '%s').",
+           ri->nickname, ri->contact_info ? ri->contact_info : "");
     *msg = "Rejected: There is already a verified server with this nickname and a different fingerprint.";
     routerinfo_free(ri);
     *desc = end;
@@ -358,7 +359,8 @@
   now = time(NULL);
   if (ri->published_on > now+ROUTER_ALLOW_SKEW) {
     log_fn(LOG_NOTICE, "Publication time for nickname '%s' is too far (%d minutes) in the future; possible clock skew. Not adding (ContactInfo '%s').",
-           ri->nickname, (int)((ri->published_on-now)/60), ri->contact_info);
+           ri->nickname, (int)((ri->published_on-now)/60),
+           ri->contact_info ? ri->contact_info : "");
     *msg = "Rejected: Your clock is set too far in the future, or your timezone is not correct.";
     routerinfo_free(ri);
     *desc = end;
@@ -366,14 +368,16 @@
   }
   if (ri->published_on < now-ROUTER_MAX_AGE) {
     log_fn(LOG_NOTICE, "Publication time for router with nickname '%s' is too far (%d minutes) in the past. Not adding (ContactInfo '%s').",
-           ri->nickname, (int)((now-ri->published_on)/60), ri->contact_info);
+           ri->nickname, (int)((now-ri->published_on)/60),
+           ri->contact_info ? ri->contact_info : "");
     *msg = "Rejected: Server is expired, or your clock is too far in the past, or your timezone is not correct.";
     routerinfo_free(ri);
     *desc = end;
     return -1;
   }
   if (dirserv_router_has_valid_address(ri) < 0) {
-    log_fn(LOG_NOTICE, "Router with nickname '%s' has invalid address '%s'. Not adding (ContactInfo '%s').", ri->nickname, ri->address, ri->contact_info);
+    log_fn(LOG_NOTICE, "Router with nickname '%s' has invalid address '%s'. Not adding (ContactInfo '%s').",
+           ri->nickname, ri->address, ri->contact_info ? ri->contact_info : "");
     *msg = "Rejected: Address is not an IP, or IP is a private address.";
     routerinfo_free(ri);
     *desc = end;



More information about the tor-commits mailing list