[tracker] libtracker-sparql: Avoid strcmp() build warnings in cursor_get_boolean()
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-sparql: Avoid strcmp() build warnings in cursor_get_boolean()
- Date: Sat, 19 Oct 2013 15:40:06 +0000 (UTC)
commit b26f48104ee4f71a2acec994a76a9de0dcb18929
Author: Martyn Russell <martyn lanedo com>
Date: Sat Oct 19 15:59:11 2013 +0100
libtracker-sparql: Avoid strcmp() build warnings in cursor_get_boolean()
src/libtracker-sparql/tracker-cursor.vala | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-cursor.vala b/src/libtracker-sparql/tracker-cursor.vala
index 90f2b52..42c1a6a 100644
--- a/src/libtracker-sparql/tracker-cursor.vala
+++ b/src/libtracker-sparql/tracker-cursor.vala
@@ -266,7 +266,12 @@ public abstract class Tracker.Sparql.Cursor : Object {
ValueType type = get_value_type (column);
return_val_if_fail (type == ValueType.BOOLEAN, 0);
unowned string as_str = get_string (column);
- return (strcmp (as_str, "true") == 0);
+
+ if (as_str != null && as_str.ascii_casecmp ("true") == 0) {
+ return true;
+ }
+
+ return false;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]