[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.2.4] Avoid clang warnings from implicit off_t->size_t cast



commit 8b6a952c94bbc7bd3a9dc3356e708654092e08af
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Sat Mar 23 18:50:21 2013 -0400

    Avoid clang warnings from implicit off_t->size_t cast
---
 src/common/crypto_curve25519.c |    2 +-
 src/test/test_crypto.c         |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/crypto_curve25519.c b/src/common/crypto_curve25519.c
index 3e4004d..88c723f 100644
--- a/src/common/crypto_curve25519.c
+++ b/src/common/crypto_curve25519.c
@@ -169,7 +169,7 @@ curve25519_keypair_read_from_file(curve25519_keypair_t *keypair_out,
 
  end:
   if (content) {
-    memwipe(content, 0, st.st_size);
+    memwipe(content, 0, (size_t) st.st_size);
     tor_free(content);
   }
   if (r != 0) {
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index c531c60..fcaa081 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -1097,7 +1097,7 @@ test_crypto_curve25519_persist(void *arg)
   tor_free(tag);
 
   content[69] ^= 0xff;
-  tt_int_op(0, ==, write_bytes_to_file(fname, content, st.st_size, 1));
+  tt_int_op(0, ==, write_bytes_to_file(fname, content, (size_t)st.st_size, 1));
   tt_int_op(-1, ==, curve25519_keypair_read_from_file(&keypair2, &tag, fname));
 
  done:

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits