[tracker/wip/carlosg/coverity-fixes: 10/10] libtracker-data: Drop always-true statement
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/coverity-fixes: 10/10] libtracker-data: Drop always-true statement
- Date: Wed, 4 Mar 2020 22:21:50 +0000 (UTC)
commit 06461bcb327f804d98896be3aad52b1fb5018fae
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Mar 4 20:33:30 2020 +0100
libtracker-data: Drop always-true statement
In IRIREF we check for a specific set of unicode chars, between them
there's the condition:
!(ch >= 0x00 && ch <= 0x20)
Where coverity complains that ch >= 0x00 is always true (as ch is
unsigned). This is indeed true, so the condition can be expressed as:
!(ch <= 0x20)
or simplified as:
ch > 0x20
CID: #1491434
src/libtracker-data/tracker-sparql-grammar.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-sparql-grammar.h b/src/libtracker-data/tracker-sparql-grammar.h
index 0372a890f..f8cc8a1bf 100644
--- a/src/libtracker-data/tracker-sparql-grammar.h
+++ b/src/libtracker-data/tracker-sparql-grammar.h
@@ -1656,7 +1656,7 @@ terminal_IRIREF (const gchar *str,
ch != '"' && ch != '{' &&
ch != '}' && ch != '|' &&
ch != '^' && ch != '`' &&
- ch != '\\' && !(ch >= 0x00 && ch <= 0x20)));
+ ch != '\\' && ch > 0x20));
ACCEPT_CHAR ((ch == '>'));
*str_out = str;
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]