Re: [hatari-devel] Warnings

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On 03/10/2020 at 14:22, Thorsten Otto wrote:
On Samstag, 3. Oktober 2020 13:32:17 CEST Vincent Rivière wrote:

 > if (isprint((unsigned int)c)) ...

If char is signed, that will still sign-extend the value, so the correct usage would be if (isprint((unsigned char)c)) ... but only if c is actually a char, not an int value that could also be EOF.

Apologies, you're right.
This is what I had in mind (I used it several times), but I wrote it from the top of my head, and fatally this was wrong.
Thanks for your vigilance.

--
Vincent Rivière



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/