[tracker/wip/carlosg/coverity-fixes: 8/8] libtracker-data: Drop always-true statement



commit bd07941f23e668a1219f517d1c32068552a2bb0f
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]