changeset 40506:81ab7b9aefcc

(to_multibyte): Ensure read_buffer is at least twice as large as the number of bytes to convert.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 30 Oct 2001 16:35:07 +0000
parents 8330d988f4aa
children 83c608283246
files src/lread.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Tue Oct 30 16:10:09 2001 +0000
+++ b/src/lread.c	Tue Oct 30 16:35:07 2001 +0000
@@ -1790,7 +1790,7 @@
   int nbytes;
 
   parse_str_as_multibyte (read_buffer, *p - read_buffer, &nbytes, nchars);
-  if (nbytes > read_buffer_size)
+  if (read_buffer_size < 2 * nbytes)
     {
       int offset = *p - read_buffer;
       read_buffer_size *= 2;
@@ -2239,6 +2239,9 @@
 	if (c < 0)
 	  end_of_file_error ();
 
+	if (p - read_buffer == 24183)
+	  fprintf (stderr, "hello\n");
+
 	/* If purifying, and string starts with \ newline,
 	   return zero instead.  This is for doc strings
 	   that we are really going to find in etc/DOC.nn.nn  */