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

[tor-commits] [tor/master] Fix a signed/unsigned comparison warning



commit ad382049ed9b3408992a7a7ee4dfe2ecdb1d5897
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Jan 25 13:23:08 2017 -0500

    Fix a signed/unsigned comparison warning
---
 src/common/compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/compat.c b/src/common/compat.c
index 16b2229..0dbede6 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -258,7 +258,7 @@ tor_mmap_file(const char *filename)
   page_size = getpagesize();
   size += (size%page_size) ? page_size-(size%page_size) : 0;
 
-  if (st.st_size > SSIZE_T_CEILING || size < st.st_size) {
+  if (st.st_size > SSIZE_T_CEILING || (off_t)size < st.st_size) {
     log_warn(LD_FS, "File \"%s\" is too large. Ignoring.",filename);
     errno = EFBIG;
     close(fd);

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