diff src/fileio.c @ 102752:9e5b3ff07060

(Finsert_file_contents): Don't limit size to INT_MAX/4.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 28 Mar 2009 02:06:06 +0000
parents f6d9599ddae1
children b6116169967f
line wrap: on
line diff
--- a/src/fileio.c	Fri Mar 27 18:40:04 2009 +0000
+++ b/src/fileio.c	Sat Mar 28 02:06:06 2009 +0000
@@ -3300,7 +3300,11 @@
 	     overflow.  The calculations below double the file size
 	     twice, so check that it can be multiplied by 4 safely.  */
 	  if (XINT (end) != st.st_size
-	      || st.st_size > INT_MAX / 4)
+	      /* Actually, it should test either INT_MAX or LONG_MAX
+		 depending on which one is used for EMACS_INT.  But in
+		 any case, in practice, this test is redundant with the
+		 one above.
+		 || st.st_size > INT_MAX / 4 */)
 	    error ("Maximum buffer size exceeded");
 
 	  /* The file size returned from stat may be zero, but data