On Wed, 16 Jan 2008, Allin Cottrell wrote:
> With current CVS for win32, cross-built using mingw, I'm getting a
> segfault when passing "pause -1" in a gnuplot input file...
Analysis after some searching:
When fed "pause -1" on win32, pause_command() in command.c will
end up calling Pause(), in winmain.c, with a NULL argument. (This
fact is new as of revision 1.161 of command.c, October 2007). The
Pause() function reads as follows:
pausewin.Message = str;
return (PauseBox(&pausewin) == IDOK);
And then PauseBox() has the line:
width = max(24,4+_fstrlen(lppw->Message)) * tm.tmAveCharWidth;
so _fstrlen will be called on a NULL argument. I guess that's the
crash right there.
This could be fixed at various different levels; I'm not sure
where's the "right place".
Department of Economics
Wake Forest University, NC