mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-02-08 04:30:32 +01:00
Correct check to prevent the display of invalid ASCII codes
Cppcheck found it as a logical conjunction always evaluates to false: EXPR < 32 && EXPR > 126. Change the expression to an Or. https://bugs.freedesktop.org/show_bug.cgi?id=71066 Signed-off-by: Richard Hughes <richard@hughsie.com>
This commit is contained in:
parent
33a3af8008
commit
1a8ccbcefc
1 changed files with 1 additions and 1 deletions
|
|
@ -213,7 +213,7 @@ up_device_wup_parse_command (UpDeviceWup *wup, const gchar *data)
|
|||
/* replace the first ';' char with a NULL if it exists */
|
||||
length = strlen (packet);
|
||||
for (i=0; i<length; i++) {
|
||||
if (packet[i] < 0x20 && packet[i] > 0x7e)
|
||||
if (packet[i] < 0x20 || packet[i] > 0x7e)
|
||||
packet[i] = '?';
|
||||
if (packet[i] == ';') {
|
||||
packet[i] = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue