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:
Eric Koegel 2014-09-15 17:42:25 +03:00 committed by Richard Hughes
parent 33a3af8008
commit 1a8ccbcefc

View file

@ -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';