Re: Bugs in PGNSaveToFile
Antonio Ceballos <[email protected]> Mon, 16 Jul 2018 19:18:02 +0200
| Newsgroups | gmane.comp.gnu.chess.bugs |
|---|---|
| Message-ID | <CAO7R9g9hLX=R+bgn238a9tbAEzby-HzbzkNJ7BDbQSJmGEoZSw@mail.gmail.com> |
--===============6661135883497028559== Content-Type: multipart/alternative; boundary="000000000000b8822a0571210361" --000000000000b8822a0571210361 Content-Type: text/plain; charset="UTF-8" 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 On Mon, Jul 16, 2018 at 4:06 AM Roland Illig <[email protected]> wrote: > 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 > > _______________________________________________ > Bug-gnu-chess mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/bug-gnu-chess > --000000000000b8822a0571210361 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hi Roland,</div><div><br></div><div>Thank you very mu= ch for your contributions. I noticed the new German translation</div><div>f= ew days ago.=C2=A0</div><div><br></div><div>If you have a patch for the bug= s you are reporting, please send it to me. That would</div><div> be great. = Otherwise, I will get back to your report when I can, and will include a fi= x</div><div>in a future release, along with the new translation.<br></div><= div><br></div><div>Regards,</div><div>Antonio<br></div></div><br><div class= =3D"gmail_quote"><div dir=3D"ltr">On Mon, Jul 16, 2018 at 4:06 AM Roland Il= lig <<a href=3D"mailto:[email protected]">[email protected]</a>> = wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e= x;border-left:1px #ccc solid;padding-left:1ex">Dear GNU Chess developers,<b= r> <br> while translating GNU Chess into German, I stumbled upon the<br> PGNSaveToFile function and noticed some bugs:<br> <br> * The result of getchar() is saved in a char variable. That variable is<br> later passed to tolower, resulting in undefined behavior. The variable<br> type should be int.<br> <br> * If the input stream ends during "while( getchar() !=3D '\n' = )", the<br> program gets stuck in a CPU-consuming endless loop.<br> <br> * In that same loop, the parenthesis is placed wrong. This is just a<br> formatting issue. The formatting in this function is inconsistent in<br> several other places, too.<br> <br> * The code explicitly checks for the characters "yn", which only = works<br> well for English. For example, German requires "jn", French requi= res<br> "on", Spanish requires "sn". It would be better to use = the rpmatch<br> function instead.<br> <br> Best,<br> Roland<br> <br> _______________________________________________<br> Bug-gnu-chess mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Bug-gnu-chess@gn= u.org</a><br> <a href=3D"https://lists.gnu.org/mailman/listinfo/bug-gnu-chess" rel=3D"nor= eferrer" target=3D"_blank">https://lists.gnu.org/mailman/listinfo/bug-gnu-c= hess</a><br> </blockquote></div> --000000000000b8822a0571210361-- --===============6661135883497028559== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-gnu-chess mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-gnu-chess --===============6661135883497028559==--