Mail Archives: djgpp/1992/09/04/10:43:36
The following program fails with segmentation violation with djgpp 1.08
on my machine.
(This is just a stupid test case)
#include <stdio.h>
main()
{
setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
printf("Hello\n");
return(0);
}
after the following patch of libsrc/c/io/setvbuf.c the program works
as expected. I hope the patch doesn't break anything else.
Dieter
-------------- Cut here ------------
*** setvbufc.org Fri Sep 4 19:58:16 1992
--- setvbuf.c Fri Sep 4 19:58:36 1992
***************
*** 38,44 ****
f->_flag |= type;
if (mine)
f->_flag |= _IOMYBUF;
! f->_base = buf;
f->_bufsiz = len;
return 0;
case _IONBF:
--- 38,44 ----
f->_flag |= type;
if (mine)
f->_flag |= _IOMYBUF;
! f->_ptr = f->_base = buf;
f->_bufsiz = len;
return 0;
case _IONBF:
- Raw text -