This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 client/session.c |   15 +++++++--------
 src/obex.c       |    2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 22a2389fe7b81ceffe1c037a1990987aab83f0be
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date:   Fri Nov 21 16:05:50 2008 -0300

    Fixes a segfault when trying to destroy the pbap context

commit f21b5473e476ea135656e55d0f02c30beff66f3f
Author: Vinicius Costa Gomes <[EMAIL PROTECTED]>
Date:   Thu Nov 20 18:17:33 2008 -0300

    Use the right types when appending the folder listing data


Diff in this email is a maximum of 400 lines.
diff --git a/client/session.c b/client/session.c
index 6706d25..03ddffd 100644
--- a/client/session.c
+++ b/client/session.c
@@ -879,7 +879,7 @@ static void xml_element(GMarkupParseContext *ctxt,
 {
        DBusMessageIter dict, *iter = user_data;
        gchar *key;
-       gint i, dtype = DBUS_TYPE_STRING;
+       gint i;
 
        if (strcasecmp("folder", element) != 0 && strcasecmp("file", element) 
!= 0)
                return;
@@ -896,13 +896,12 @@ static void xml_element(GMarkupParseContext *ctxt,
        i = 0;
        for (key = (gchar *) names[i]; key; key = (gchar *) names[++i]) {
                key[0] = g_ascii_toupper(key[0]);
-               if (strcmp("Accessed", key) == 0 ||
-                       strcmp("Created", key) == 0 ||
-                       strcmp("Modified", key)== 0 ||
-                       strcmp("Size", key)== 0)
-                       dtype = DBUS_TYPE_UINT64;
-
-               dict_append_entry(&dict, key, dtype, &values[i]);
+               if (g_str_equal("Size", key) == TRUE) {
+                       guint64 size;
+                       size = g_ascii_strtoll(values[i], NULL, 10);
+                       dict_append_entry(&dict, key, DBUS_TYPE_UINT64, &size);
+               } else
+                       dict_append_entry(&dict, key, DBUS_TYPE_STRING, 
&values[i]);
        }
 
        dbus_message_iter_close_container(iter, &dict);
diff --git a/src/obex.c b/src/obex.c
index 0dd84fc..0bedbe3 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -135,7 +135,7 @@ static void obex_session_free(struct obex_session *os)
        if (os->current_folder)
                g_free(os->current_folder);
 
-       if (!memcmp(os->target, PBAP_TARGET, TARGET_SIZE))
+       if (os->target && !memcmp(os->target, PBAP_TARGET, TARGET_SIZE))
                pbap_phonebook_context_destroy(os);
 
        g_free(os);
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to