Browse Source

tor --list-fingerprint as a client shouldn't try to print null

svn:r2697
Roger Dingledine 21 years ago
parent
commit
efad93feb4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/or/main.c

+ 2 - 1
src/or/main.c

@@ -1117,6 +1117,7 @@ static void do_list_fingerprint(void)
 {
 {
   char buf[FINGERPRINT_LEN+1];
   char buf[FINGERPRINT_LEN+1];
   crypto_pk_env_t *k;
   crypto_pk_env_t *k;
+  const char *nickname = get_options()->Nickname;
   if (init_keys() < 0) {
   if (init_keys() < 0) {
     log_fn(LOG_ERR,"Error initializing keys; exiting");
     log_fn(LOG_ERR,"Error initializing keys; exiting");
     return;
     return;
@@ -1129,7 +1130,7 @@ static void do_list_fingerprint(void)
     log_fn(LOG_ERR, "Error computing fingerprint");
     log_fn(LOG_ERR, "Error computing fingerprint");
     return;
     return;
   }
   }
-  printf("%s %s\n", get_options()->Nickname, buf);
+  printf("%s %s\n", nickname?nickname:"client", buf);
 }
 }
 
 
 /** DOCDOC **/
 /** DOCDOC **/