I was trying to change some bad translations in text/pt.tab, then I tried to insert a bus stop in the city. Simutrans returned me Application error: The memory can't be "read".
The text/pt.tab was:
%s city %d %s
%s - %dª %s urbana
My city already had some bus stops inserted and, as I was seeing the ª character is badly "drawn" in the screen, I changed it to:
%s city %d %s
%s %s %d urbana
I inserted another bus stop: crash.
Savegame: http://simutrans-germany.com/files/upload/March_2011.sve
EDIT:
The workaround for this bug: I removed the "bad" character from all bus stops. I inserted another bus stop in the city: no crash.
This is not a bug that can be "fixed". You must give format arguments exactly in the same order as they appear, end of discussion. The only fix possible is exchanging the conversion functions for something custom.
Translator's life generally sucks, yeah :-/
Simple, I removed the "%d" from translation.
%s city %d %s
%s %s urbana
%s land %d %s
%s %s rural
Worked.
EDIT:
No, the bug is back.
Trying another thing that makes sense in Latin syntax :S
Programmer info:
It seems there is a non-C99 extension widely available on linux [1] [2] [3] [4] [5] that allows changes to order. Not available for Microsoft compilers though (yeah, we love you...). Alternatives include: Boost format library [6], which at a glance seems to be unnecessarily bloated as it uses streams internally. And that's it, hooray :-/ There is some discussion on this [7]...
[1] http://linux.die.net/man/3/snprintf
[2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html
[3] http://linux.about.com/library/cmd/blcmdl3_snprintf.htm
[4] http://manpages.ubuntu.com/manpages/intrepid/man3/printf.3.html
[5] http://www.openbsd.org/cgi-bin/man.cgi?query=printf&sektion=3
[6] http://www.boost.org/doc/libs/1_46_1/libs/format/doc/format.html
[7] http://stackoverflow.com/questions/3913009/is-there-any-alternative-for-printf
We had the discussion several times already. There are various libraries which could fix this, and all of them are either bloated, suck or both or not compatible with artistic licence ...