From 1a8ccbcefc29f863ec6317e319f7de471a3fbbbe Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Mon, 15 Sep 2014 17:42:25 +0300 Subject: 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 --- src/linux/up-device-wup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 0x7e) + if (packet[i] < 0x20 || packet[i] > 0x7e) packet[i] = '?'; if (packet[i] == ';') { packet[i] = '\0'; -- cgit v1.2.1