one-line fix for file overflow

Zack Weinberg zack@wolery.cumb.org
Sun Apr 16 00:35:00 GMT 2000


This fixes a bug where under unusual conditions we could think the
file was too big when it wasn't.

zw

	* cpplex.c (_cpp_read_and_prescan): Enlarge len by setting it
	to offset * 2.

===================================================================
Index: cpplex.c
--- cpplex.c	2000/04/16 02:18:52	1.14
+++ cpplex.c	2000/04/16 07:34:12
@@ -1651,7 +1651,7 @@ _cpp_read_and_prescan (pfile, fp, desc, 
 	    {
 	      size_t delta_op;
 	      size_t delta_line_base;
-	      len *= 2;
+	      len = offset * 2;
 	      if (offset > len)
 		/* len overflowed.
 		   This could happen if the file is larger than half the


More information about the Gcc-patches mailing list