]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a signed/unsigned comparison warning
authorNick Mathewson <nickm@torproject.org>
Wed, 25 Jan 2017 18:23:08 +0000 (13:23 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 25 Jan 2017 18:23:08 +0000 (13:23 -0500)
src/common/compat.c

index 16b222904ab9d0e2e1c70afb6126952ed82490b7..0dbede6bedc6927204a712d710178e6e4ca5c35d 100644 (file)
@@ -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);