I was using gnuplot do some system calls, and then discovered this issue.
When I use sprintf to create a "long" string (greater than 260 chars), and it has double percents (%%), gnuplot will crash (I am using Xubuntu 16.04).
If I substitute the %% by the respective formatting string (i.e. by inserting %s in the string, and "%" as argument of sprintf), there will be no issue.
I am providing a simple script which triggers the issue in my system.
I will copy and paste the script here to make it easier.
Last edit: Rafael C. Barreto 2018-01-20
Diff:
Thank you for the report and the test case.
Fixed now for 5.2 and 5.3
If you really need a fix for 5.0, the patch below prepared for 5.2 may work but I have not tested it.
Thank you for the fast fix!
I downloaded the code from the repository, compiled, and it worked fine in my box.
I did not test with the 5.0 sources.... but I do not think it is really necessary.
For now, to avoid the issue in the xubuntu 16.04 pre-compiled binaries, I am explicitly printing the percent symbol.
print sprint(" some text %s foo bar ", "%")
Best regards and keep up the good work!