>>>> "Fabrice" == Fabrice Popineau
<Fabrice.Popineau(a)supelec.fr> writes:
Fabrice> Not at all. Stephen's patch was abour enlarging the
Fabrice> buffer. But that doesn't cure the fact that :
Wow! I wonder why my patch worked at all; I guess my compiler (GCC)
pads to a multiple of wordsize or something like that, while yours
doesn't. Thanks for catching this!
Fabrice> Ibyte buf[DOC_MAX_FILENAME_LENGTH+1];
Fabrice> Ibyte *buffer = buf;
Fabrice> int buffer_size = sizeof (buf), space_left;
Since the '\0' is actually an artificial sentinel, I suggest
(1) change the init code to
Ibyte buf[DOC_MAX_FILENAME_LENGTH+1];
Ibyte *buffer = buf;
int buffer_size = sizeof (buf) - 1, /* omit sentinel position */
space_left;
(2) change all other uses of DOC_MAX_FILENAME_LENGTH to buffer_size.
--
School of Systems and Information Engineering
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Just Say No to porting sucky GNU code!