Explorar o código

Fix a compile warning on OS X 10.6 and up

Sebastian Hahn %!s(int64=14) %!d(string=hai) anos
pai
achega
cce85c819b
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/common/util.c

+ 3 - 1
src/common/util.c

@@ -3894,7 +3894,9 @@ get_string_from_pipe(FILE *stream, char *buf_out, size_t count)
   char *retval;
   size_t len;
 
-  retval = fgets(buf_out, count, stream);
+  tor_assert(count <= INT_MAX);
+
+  retval = fgets(buf_out, (int)count, stream);
 
   if (!retval) {
     if (feof(stream)) {