diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2014-09-15 17:42:25 +0300 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-09-16 10:34:42 +0100 |
commit | 1a8ccbcefc29f863ec6317e319f7de471a3fbbbe (patch) | |
tree | 00dba6c6e410f30094856e482bfb16989033a356 | |
parent | 33a3af8008520f472727bf2144bae9a7585bc53e (diff) | |
download | upower-1a8ccbcefc29f863ec6317e319f7de471a3fbbbe.tar.gz |
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>
-rw-r--r-- | src/linux/up-device-wup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linux/up-device-wup.c b/src/linux/up-device-wup.c index b2f5c96..914741e 100644 --- a/src/linux/up-device-wup.c +++ b/src/linux/up-device-wup.c @@ -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'; |