[tor-commits] [tor/master] changes suggested by weasel

nickm at torproject.org nickm at torproject.org
Sun Jan 18 21:07:16 UTC 2015


commit 31838bd7833b231e818fed7c1774cee8bd6ca4d7
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jan 16 11:46:20 2015 -0500

    changes suggested by weasel
---
 src/or/config.c  |    2 --
 src/or/control.c |   10 ++++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index 5bd5ff4..b9a567b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -6441,8 +6441,6 @@ write_configuration_file(const char *fname, const or_options_t *options)
   if (!fname)
     return -1;
 
-  tor_assert(fname);
-
   switch (file_status(fname)) {
     case FN_FILE:
       old_val = read_file_to_str(fname, 0, NULL);
diff --git a/src/or/control.c b/src/or/control.c
index 21d2e09..a569c96 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1439,11 +1439,13 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
   if (!strcmp(question, "version")) {
     *answer = tor_strdup(get_version());
   } else if (!strcmp(question, "config-file")) {
-    if (get_torrc_fname(0))
-      *answer = tor_strdup(get_torrc_fname(0));
+    const char *a = get_torrc_fname(0);
+    if (a)
+      *answer = tor_strdup(a);
   } else if (!strcmp(question, "config-defaults-file")) {
-    if (get_torrc_fname(1))
-      *answer = tor_strdup(get_torrc_fname(1));
+    const char *a = get_torrc_fname(1);
+    if (a)
+      *answer = tor_strdup(a);
   } else if (!strcmp(question, "config-text")) {
     *answer = options_dump(get_options(), OPTIONS_DUMP_MINIMAL);
   } else if (!strcmp(question, "info/names")) {





More information about the tor-commits mailing list