]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
config.c: make a couple of arguments const.
authorNick Mathewson <nickm@torproject.org>
Tue, 8 Oct 2019 15:37:46 +0000 (11:37 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 8 Oct 2019 16:59:22 +0000 (12:59 -0400)
These functions do not modify their inputs, so they can take const
arguments.

src/app/config/config.c

index 26b1048022548c41297e75dbd29c6b8c8732549d..1abe1e13a3c84596d6f72a6508c45e9b04c7aa80 100644 (file)
@@ -5060,12 +5060,12 @@ normalize_nickname_list(config_line_t **normalized_out,
  * filename if it doesn't exist.
  */
 static char *
-find_torrc_filename(config_line_t *cmd_arg,
+find_torrc_filename(const config_line_t *cmd_arg,
                     int defaults_file,
                     int *using_default_fname, int *ignore_missing_torrc)
 {
   char *fname=NULL;
-  config_line_t *p_index;
+  const config_line_t *p_index;
   const char *fname_opt = defaults_file ? "--defaults-torrc" : "-f";
   const char *ignore_opt = defaults_file ? NULL : "--ignore-missing-torrc";
 
@@ -5144,7 +5144,7 @@ load_torrc_from_stdin(void)
  * Return the contents of the file on success, and NULL on failure.
  */
 static char *
-load_torrc_from_disk(config_line_t *cmd_arg, int defaults_file)
+load_torrc_from_disk(const config_line_t *cmd_arg, int defaults_file)
 {
   char *fname=NULL;
   char *cf = NULL;