udev: fix codesonar warnings
authorAmitanand.Chikorde <amitanand.chikorde@kpit.com>
Thu, 30 Jul 2020 13:18:48 +0000 (18:48 +0530)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 20 Sep 2020 09:10:14 +0000 (11:10 +0200)
commit1b9c95bfbf7e5fc32e033851bf06f0a9f7f9f08b
treecd194df51ce7f74302458b5378eb32ef643f5705
parentc5883bc08877d8bad10110434037a3c21950a71a
udev: fix codesonar warnings

Fixed below systemd codesonar warning.
isprint() is invoked here with an argument of signed
type char, but only has defined behavior for int arguments that are
either representable as unsigned char or equal to the value
of macro EOF(-1).

As per codesonar report, in a number of libc implementations, isprint()
function implemented using lookup tables (arrays): passing in a
negative value can result in a read underrun.

(cherry picked from commit e7e954243a17cceb5278aac6249ee0dcc119b1eb)
src/udev/udevadm-info.c