If script uses win32-style newline character \r\n, and there exists empty line, mgl_parse_text will cause crash. For example:
mgl_parse_text( gr, parser, "box\r\n\r\naxis" ); // crash
mgl_parse_text( gr, parser, "box\n\naxis" ); // OK with Linux-style newline character
mgl_parse_text( gr, parser, "box\r\naxis" ); // OK without empty line
My compiler is Visual Studio 2003.
BTW: The problem does not exist in mathgl v2.0.3
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I don't see a bug. Which version do you use? and under which OS?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2013-12-25
I use MathGLv2.1.3.
I found the bug under WinXP SP3 CHS and Win2000 SP4 CHS.
I use compiler option - /MDd .
I just test following code ,the bug still exists.
HMPR parser = mgl_create_parser();
mgl_parse_text( gr, parser, "box\r\n\r\naxis" );
mgl_delete_parser(parser);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If script uses win32-style newline character \r\n, and there exists empty line, mgl_parse_text will cause crash. For example:
mgl_parse_text( gr, parser, "box\r\n\r\naxis" ); // crash
mgl_parse_text( gr, parser, "box\n\naxis" ); // OK with Linux-style newline character
mgl_parse_text( gr, parser, "box\r\naxis" ); // OK without empty line
My compiler is Visual Studio 2003.
BTW: The problem does not exist in mathgl v2.0.3
Hi, I don't see a bug. Which version do you use? and under which OS?
I use MathGLv2.1.3.
I found the bug under WinXP SP3 CHS and Win2000 SP4 CHS.
I use compiler option - /MDd .
I just test following code ,the bug still exists.
HMPR parser = mgl_create_parser();
mgl_parse_text( gr, parser, "box\r\n\r\naxis" );
mgl_delete_parser(parser);
Can you test it with latest version (i.e. v.2.2)? Since you are using v.2.*.
Thanks for your replay.
I have tested the same code with v2.2, it's OK.
This time, the tested library file is created from source code with vs2008.