]> git.eshelyaron.com Git - emacs.git/commitdiff
(Finsert_file_contents): Don't limit size to INT_MAX/4.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 28 Mar 2009 02:06:06 +0000 (02:06 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 28 Mar 2009 02:06:06 +0000 (02:06 +0000)
src/ChangeLog
src/fileio.c

index fa0edf01055ac988cc32b6f29206b4059252141f..7e84e2f934a397626700fcfffe7f63ba68b3531e 100644 (file)
@@ -1,3 +1,7 @@
+2009-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fileio.c (Finsert_file_contents): Don't limit size to INT_MAX/4.
+
 2009-03-27  Jan Djärv  <jan.h.d@swipnet.se>
 
        * frame.c (x_set_font): If the fullscreen property is non-nil, adjust
index 4f3573b02d7886cc45005228c119bd2cb48b181b..93b6a1d82985d67c5d8fd82fa048f81a56464b54 100644 (file)
@@ -3300,7 +3300,11 @@ variable `last-coding-system-used' to the coding system actually used.  */)
             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