]> git.eshelyaron.com Git - emacs.git/commitdiff
(to_multibyte): Ensure read_buffer is at least twice
authorGerd Moellmann <gerd@gnu.org>
Tue, 30 Oct 2001 16:37:27 +0000 (16:37 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 30 Oct 2001 16:37:27 +0000 (16:37 +0000)
as large as the number of bytes to convert.

src/lread.c

index c94a1f291f02327506195cca249572f719cbe88c..8b78a7d3d7a0f3fb3380e8967336c16abfc486c5 100644 (file)
@@ -1778,7 +1778,7 @@ to_multibyte (p, end, nchars)
   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;