aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2012-05-27 18:28:15 +0200
committerNick Mathewson <nickm@torproject.org>2012-05-30 11:56:43 -0400
commita5a8296892441bf43553f294bcdbc54b428b621f (patch)
treeb2fdc15fb55777ca135eff3f87862781c35c16bf /src
parentbf16e167f79afc5367422ee7e0c0b3587dc6c82d (diff)
downloadtor-a5a8296892441bf43553f294bcdbc54b428b621f.tar
tor-a5a8296892441bf43553f294bcdbc54b428b621f.tar.gz
Fix clang 3.1 compile warning in crypto.c
(Tweaked by nickm)
Diffstat (limited to 'src')
-rw-r--r--src/common/crypto.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index f82598fab..8feac95ac 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1806,7 +1806,6 @@ crypto_get_stored_dynamic_dh_modulus(const char *fname)
char *contents = NULL;
const char *contents_tmp = NULL;
int dh_codes;
- char *fname_new = NULL;
DH *stored_dh = NULL;
BIGNUM *dynamic_dh_modulus = NULL;
int length = 0;
@@ -1881,12 +1880,10 @@ crypto_get_stored_dynamic_dh_modulus(const char *fname)
err:
- { /* move broken prime to $filename.broken */
- fname_new = tor_malloc(strlen(fname) + 8);
-
- /* no can do if these functions return error */
- strlcpy(fname_new, fname, strlen(fname) + 8);
- strlcat(fname_new, ".broken", strlen(fname) + 8);
+ {
+ /* move broken prime to $filename.broken */
+ char *fname_new=NULL;
+ tor_asprintf(&fname_new, "%s.broken", fname);
log_warn(LD_CRYPTO, "Moving broken dynamic DH prime to '%s'.", fname_new);