]> git.ipfire.org Git - thirdparty/u-boot.git/commit
board: dhelectronics: Use isascii() before isprint() in dh_read_eeprom_id_page()
authorMarek Vasut <marek.vasut@mailbox.org>
Sun, 7 Sep 2025 01:00:47 +0000 (03:00 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 17 Sep 2025 15:06:37 +0000 (09:06 -0600)
commit7cd9d2db2627ce65d3c03e4422607b7a86093e8a
tree675519131a778ab5ec57166cf56b18d043e4f41e
parent5634cf1afcf17fda0136693f02a843aa6b938b2b
board: dhelectronics: Use isascii() before isprint() in dh_read_eeprom_id_page()

The isprint() checks printability across all 256 characters, some of the
upper 128 characters are printable and produce artifacts on UART. Call
isascii() first to only consider the bottom 7bit ASCII characters as
printable, and then check their printability using isprint(). This fixes
a rare misprint in case the ID page content is uninitialized or corrupted.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
board/dhelectronics/common/dh_common.c