summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-11 14:02:59 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-16 15:03:13 -0500
commitcc02823d7f6acbc3fa8ea87e5646921100796f10 (patch)
tree45d4ba4a4cc9ef73c076f08934f68d9690b9044c /src/or/circuitbuild.c
parentedcc9981d8b8894d2ef4e0d617a20d7d99547817 (diff)
downloadtor-cc02823d7f6acbc3fa8ea87e5646921100796f10.tar.gz
tor-cc02823d7f6acbc3fa8ea87e5646921100796f10.zip
Convert instances of tor_snprintf+strdup into tor_asprintf
These were found by looking for tor_snprintf() instances that were followed closely by tor_strdup(), though I probably converted some other snprintfs as well.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 216c926585..88916d6596 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -4441,10 +4441,8 @@ entry_guards_update_state(or_state_t *state)
continue; /* don't write this one to disk */
*next = line = tor_malloc_zero(sizeof(config_line_t));
line->key = tor_strdup("EntryGuard");
- line->value = tor_malloc(HEX_DIGEST_LEN+MAX_NICKNAME_LEN+2);
base16_encode(dbuf, sizeof(dbuf), e->identity, DIGEST_LEN);
- tor_snprintf(line->value,HEX_DIGEST_LEN+MAX_NICKNAME_LEN+2,
- "%s %s", e->nickname, dbuf);
+ tor_asprintf(&line->value, "%s %s", e->nickname, dbuf);
next = &(line->next);
if (e->unreachable_since) {
*next = line = tor_malloc_zero(sizeof(config_line_t));