[evolution-data-server] libebook: Explicitly check e_sexp_parse() result



commit 2625a4c4e337b730fe42d035c56bfc0b49666ada
Author: Mathias Hasselmann <mathias openismus com>
Date:   Wed Jan 16 15:42:37 2013 +0100

    libebook: Explicitly check e_sexp_parse() result
    
    e_sexp_parse() returns -1 on error and 0 on success. Therefore using it
    straighly within an if() statement is confusing for the reader.

 addressbook/libebook/e-book-query.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c
index 22bf92b..79fd34a 100644
--- a/addressbook/libebook/e-book-query.c
+++ b/addressbook/libebook/e-book-query.c
@@ -687,7 +687,7 @@ e_book_query_from_string (const gchar *query_string)
 
 	e_sexp_input_text (sexp, query_string, strlen (query_string));
 
-	if (e_sexp_parse (sexp)) {
+	if (e_sexp_parse (sexp) == -1) {
 		g_warning ("%s: Error in parsing: %s", G_STRFUNC, sexp->error);
 		return NULL;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]