* src/imap.c
[claws.git] / src / imap.c
index def44b3c364c376ff93f8ed21b0e8de33ad1acea..ec7632586ce1f483136447c012999d3076c625d3 100644 (file)
@@ -1717,7 +1717,7 @@ static gint imap_rename_folder(Folder *folder, FolderItem *item,
        g_return_val_if_fail(item->path != NULL, -1);
        g_return_val_if_fail(name != NULL, -1);
 
-       if (strchr(name, imap_get_path_separator(folder, item->path)) != NULL) {
+       if (strchr(name, imap_get_path_separator(IMAP_FOLDER(folder), item->path)) != NULL) {
                g_warning(_("New folder name must not contain the namespace "
                            "path seperator"));
                return -1;
@@ -2470,7 +2470,8 @@ static gint imap_select(IMAPSession *session, IMAPFolder *folder,
 {
        gchar *real_path;
        gint ok;
-       gint exists_, recent_, unseen_, uid_validity_;
+       gint exists_, recent_, unseen_;
+       guint32 uid_validity_;
 
        if (!exists || !recent || !unseen || !uid_validity) {
                if (session->mbox && strcmp(session->mbox, path) == 0)
@@ -2722,6 +2723,7 @@ static gint imap_cmd_do_select(IMAPSession *session, const gchar *folder,
        GPtrArray *argbuf;
        gchar *select_cmd;
        gchar *folder_;
+       unsigned int uid_validity_;
 
        *exists = *recent = *unseen = *uid_validity = 0;
        argbuf = g_ptr_array_new();
@@ -2754,11 +2756,12 @@ static gint imap_cmd_do_select(IMAPSession *session, const gchar *folder,
 
        resp_str = search_array_contain_str(argbuf, "UIDVALIDITY");
        if (resp_str) {
-               if (sscanf(resp_str, "OK [UIDVALIDITY %u] ", uid_validity)
+               if (sscanf(resp_str, "OK [UIDVALIDITY %u] ", &uid_validity_)
                    != 1) {
                        g_warning("imap_cmd_select(): invalid UIDVALIDITY line.\n");
                        THROW;
                }
+               *uid_validity = uid_validity_;
        }
 
        resp_str = search_array_contain_str(argbuf, "UNSEEN");