Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bugs in PGNSaveToFile

3 views
Skip to first unread message

Roland Illig

unread,
Jul 15, 2018, 10:06:32 PM7/15/18
to bug-gn...@gnu.org
Dear GNU Chess developers,

while translating GNU Chess into German, I stumbled upon the
PGNSaveToFile function and noticed some bugs:

* The result of getchar() is saved in a char variable. That variable is
later passed to tolower, resulting in undefined behavior. The variable
type should be int.

* If the input stream ends during "while( getchar() != '\n' )", the
program gets stuck in a CPU-consuming endless loop.

* In that same loop, the parenthesis is placed wrong. This is just a
formatting issue. The formatting in this function is inconsistent in
several other places, too.

* The code explicitly checks for the characters "yn", which only works
well for English. For example, German requires "jn", French requires
"on", Spanish requires "sn". It would be better to use the rpmatch
function instead.

Best,
Roland

Antonio Ceballos

unread,
Jul 16, 2018, 1:18:21 PM7/16/18
to roland...@gmx.de, bug-gn...@gnu.org
Hi Roland,

Thank you very much for your contributions. I noticed the new German translation
few days ago. 

If you have a patch for the bugs you are reporting, please send it to me. That would
be great. Otherwise, I will get back to your report when I can, and will include a fix
in a future release, along with the new translation.

Regards,
Antonio

_______________________________________________
Bug-gnu-chess mailing list
Bug-gn...@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnu-chess
0 new messages