]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
changes suggested by weasel
authorNick Mathewson <nickm@torproject.org>
Fri, 16 Jan 2015 16:46:20 +0000 (11:46 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 16 Jan 2015 16:46:20 +0000 (11:46 -0500)
src/or/config.c
src/or/control.c

index 5bd5ff47704f6de48114776a22248affb3f942c7..b9a567b741b52b261690d8fdd34577315dc9c073 100644 (file)
@@ -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);
index 21d2e098567007d3ddbfdcbb2c5f865f442aef77..a569c962c4308be08aee0f83ddfb90659be5a89d 100644 (file)
@@ -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")) {