diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-01-10 16:53:37 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-01-10 16:53:37 -0500 |
commit | 73d4dbe103db639cf806e1610a79e4a781428d1f (patch) | |
tree | 8990943fa2cf3398fe4aa57fc42b06d495087392 /src/common/crypto.c | |
parent | eefe8857c2dfa8524310bf8c1eb89464b4e38dfa (diff) | |
download | tor-73d4dbe103db639cf806e1610a79e4a781428d1f.tar.gz tor-73d4dbe103db639cf806e1610a79e4a781428d1f.zip |
whitespace and warning fixes for bug4746
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index b1fc5eded8..e377b01d41 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1839,8 +1839,9 @@ crypto_store_dynamic_dh_modulus(const char *fname) char *base64_encoded_dh = NULL; char *file_string = NULL; int retval = -1; - const static char *file_header = "# This file contains stored Diffie-Hellman" - " parameters for future use.\n# You *do not* need to edit this file.\n\n"; + static const char file_header[] = "# This file contains stored Diffie-" + "Hellman parameters for future use.\n# You *do not* need to edit this " + "file.\n\n"; tor_assert(fname); @@ -1880,10 +1881,10 @@ crypto_store_dynamic_dh_modulus(const char *fname) } /* concatenate file header and the dh parameters blob */ - tor_asprintf(&file_string, "%s%s", file_header, base64_encoded_dh); + new_len = tor_asprintf(&file_string, "%s%s", file_header, base64_encoded_dh); /* write to file */ - if (write_bytes_to_new_file(fname, file_string, strlen(file_string), 0) < 0) { + if (write_bytes_to_new_file(fname, file_string, new_len, 0) < 0) { log_info(LD_CRYPTO, "'%s' was already occupied.", fname); goto done; } |