Hi all,
I managed to compile the latest CVS natively under Win32 (and using my
own setup ;-) but while trying the debug version, I got a stack
corruption. The following patch cures it.
--- src\doc.c~ Mon May 8 15:23:16 2006
+++ src\doc.c Fri May 12 16:00:19 2006
@@ -49,7 +49,7 @@
{
Ibyte buf[DOC_MAX_FILENAME_LENGTH+1];
Ibyte *buffer = buf;
- int buffer_size = sizeof (buf), space_left;
+ int buffer_size = sizeof (buf) - 1, space_left;
Ibyte *from, *to;
REGISTER Ibyte *p = buffer;
Lisp_Object return_me;
@@ -168,7 +168,7 @@
{
Ibyte buf[512 * 32 + 1];
Ibyte *buffer = buf;
- int buffer_size = sizeof (buf);
+ int buffer_size = sizeof (buf) - 1;
Ibyte *from, *to;
REGISTER Ibyte *p = buffer;
Lisp_Object return_me;
@@ -215,13 +215,14 @@
if (space_left == 0)
{
Ibyte *old_buffer = buffer;
+ buffer_size *= 2;
if (buffer == buf)
{
- buffer = xnew_ibytes (buffer_size *= 2);
+ buffer = xnew_ibytes (buffer_size + 1);
memcpy (buffer, old_buffer, p - old_buffer);
}
else
- XREALLOC_ARRAY (buffer, Ibyte, buffer_size *= 2);
+ XREALLOC_ARRAY (buffer, Ibyte, buffer_size + 1);
p += buffer - old_buffer;
space_left = buffer_size - (p - buffer);
}
Best regards,
--
Fabrice Popineau
------------------------
e-mail: Fabrice.Popineau(a)supelec.fr | The difference between theory
voice-mail: +33 (0) 387764715 | and practice, is that
surface-mail: Supelec, 2 rue E. Belin, | theoretically,
F-57070 Metz | there is no difference !