Skip to content

Conversation

dmadison
Copy link
Contributor

@dmadison dmadison commented Oct 7, 2021

This prevents the writeDigitAscii() function from reading outside the bounds of the font table. Values outside the printable range are printed as blanks.

This also fixes a -Wtype-limits warning accidentally introduced in #41, on platforms where char is a signed 8 bit value. This was caused by the range comparison to 127 always being 'true' due to the limits of the type.

This prevents the `writeDigitAscii()` function from reading outside the bounds of the font table. Values outside the printable range are printed as blanks.
if ((c >= ' ') && (c <= 127)) {
writeDigitAscii(position, c);
r = 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its purpose was to check whether the character is present in the font table. That functionality has been moved to writeDigitAscii() where the font table is accessed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants