diff options
author | Neel Chauhan <neel@neelc.org> | 2018-03-19 12:27:07 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-03-19 12:38:28 -0400 |
commit | bc5f79b95c5f809635bc84dbdd3010350bfbc269 (patch) | |
tree | 164f459a5976f3c808b2b567dc99310e8e049c27 /src/or/config.c | |
parent | b0f0c0f5505b3cf4cfbd4a3c1908ace4740f343b (diff) | |
download | tor-bc5f79b95c5f809635bc84dbdd3010350bfbc269.tar.gz tor-bc5f79b95c5f809635bc84dbdd3010350bfbc269.zip |
Use tor_asprintf for in have_enough_mem_for_dircache()
(Fixes bug 20887)
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/or/config.c b/src/or/config.c index 0b161554c4..212c6c6b94 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -4625,15 +4625,14 @@ have_enough_mem_for_dircache(const or_options_t *options, size_t total_mem, if (options->DirCache) { if (total_mem < DIRCACHE_MIN_MEM_BYTES) { if (options->BridgeRelay) { - *msg = tor_strdup("Running a Bridge with less than " - STRINGIFY(DIRCACHE_MIN_MEM_MB) " MB of memory is not " - "recommended."); + tor_asprintf(msg, "Running a Bridge with less than %d MB of memory " + "is not recommended.", DIRCACHE_MIN_MEM_MB); } else { - *msg = tor_strdup("Being a directory cache (default) with less than " - STRINGIFY(DIRCACHE_MIN_MEM_MB) " MB of memory is not " - "recommended and may consume most of the available " - "resources, consider disabling this functionality by " - "setting the DirCache option to 0."); + tor_asprintf(msg, "Being a directory cache (default) with less than " + "%d MB of memory is not recommended and may consume " + "most of the available resources. Consider disabling " + "this functionality by setting the DirCache option " + "to 0.", DIRCACHE_MIN_MEM_MB); } } } else { |