[telepathy-mission-control/master] McdAccountManager: reformulate expression to avoid signed/unsigned comparison

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Apr 2 11:51:44 PDT 2009


A pointer plus an unsigned is a pointer, but a pointer minus a pointer is
a ptrdiff_t which is signed.
---
 src/mcd-account-manager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index d1b6e09..ce4c8ec 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -135,7 +135,7 @@ get_account_connection (const gchar *file_contents, const gchar *path,
         endline = strchr (account_name, '\n');
         if (!endline) break;
 
-        if (len == tab1 - line &&
+        if (line + len == tab1 &&
             strncmp (path, connection_path, len) == 0)
         {
             *p_bus_name = g_strndup (bus_name, tab2 - bus_name);
-- 
1.5.6.5




More information about the telepathy-commits mailing list