[gnome-online-accounts/gnome-3-12] Fix check for non-empty strings



commit c4d2cff6f05b0ff717b3e90957a5869ef7a4ea84
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Apr 10 13:11:04 2014 +0200

    Fix check for non-empty strings
    
    Fixes: https://bugzilla.gnome.org/727957

 src/goabackend/goaewsclient.c  |   10 +++++-----
 src/goabackend/goahttpclient.c |    8 ++++----
 src/goabackend/goamailclient.c |    4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/goabackend/goaewsclient.c b/src/goabackend/goaewsclient.c
index 795bac2..57e231e 100644
--- a/src/goabackend/goaewsclient.c
+++ b/src/goabackend/goaewsclient.c
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2012, 2013 Red Hat, Inc.
+ * Copyright (C) 2012, 2013, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -443,10 +443,10 @@ goa_ews_client_autodiscover (GoaEwsClient        *client,
   xmlOutputBuffer *buf;
 
   g_return_if_fail (GOA_IS_EWS_CLIENT (client));
-  g_return_if_fail (email != NULL || email[0] != '\0');
-  g_return_if_fail (password != NULL || password[0] != '\0');
-  g_return_if_fail (username != NULL || username[0] != '\0');
-  g_return_if_fail (server != NULL || server[0] != '\0');
+  g_return_if_fail (email != NULL && email[0] != '\0');
+  g_return_if_fail (password != NULL && password[0] != '\0');
+  g_return_if_fail (username != NULL && username[0] != '\0');
+  g_return_if_fail (server != NULL && server[0] != '\0');
   g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
   doc = ews_client_create_autodiscover_xml (email);
diff --git a/src/goabackend/goahttpclient.c b/src/goabackend/goahttpclient.c
index 1b48616..114274e 100644
--- a/src/goabackend/goahttpclient.c
+++ b/src/goabackend/goahttpclient.c
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2012, 2013 Red Hat, Inc.
+ * Copyright (C) 2012, 2013, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -217,9 +217,9 @@ goa_http_client_check (GoaHttpClient       *client,
   SoupLogger *logger;
 
   g_return_if_fail (GOA_IS_HTTP_CLIENT (client));
-  g_return_if_fail (uri != NULL || uri[0] != '\0');
-  g_return_if_fail (username != NULL || username[0] != '\0');
-  g_return_if_fail (password != NULL || password[0] != '\0');
+  g_return_if_fail (uri != NULL && uri[0] != '\0');
+  g_return_if_fail (username != NULL && username[0] != '\0');
+  g_return_if_fail (password != NULL && password[0] != '\0');
   g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
   data = g_slice_new0 (CheckData);
diff --git a/src/goabackend/goamailclient.c b/src/goabackend/goamailclient.c
index 43b02c7..619cdb8 100644
--- a/src/goabackend/goamailclient.c
+++ b/src/goabackend/goamailclient.c
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2011, 2013 Red Hat, Inc.
+ * Copyright (C) 2011, 2013, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -380,7 +380,7 @@ goa_mail_client_check (GoaMailClient       *client,
   CheckData *data;
 
   g_return_if_fail (GOA_IS_MAIL_CLIENT (client));
-  g_return_if_fail (host_and_port != NULL || host_and_port[0] != '\0');
+  g_return_if_fail (host_and_port != NULL && host_and_port[0] != '\0');
   g_return_if_fail (GOA_IS_MAIL_AUTH (auth));
   g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 


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