Real fix for Coverity 1372362.
[claws.git] / src / plugins / vcalendar / vcal_meeting_gtk.c
index 2b99c08efcec0033a86dba7507cc194676ed9fb7..99e43fd4055d19253655007e5df7732406a5bff2 100644 (file)
@@ -776,7 +776,7 @@ static gchar *get_avail_msg(const gchar *unavailable_persons, gboolean multiple,
        gchar *msg, *intro = NULL, *outro = NULL, *before = NULL, *after = NULL;
 
        if (multiple)
-               intro = g_strdup(_("The following person(s) are busy at the time of your planned meeting:\n- "));
+               intro = g_strdup(_("The following people are busy at the time of your planned meeting:\n- "));
        else if (!strcmp(unavailable_persons, _("You")))
                intro = g_strdup(_("You are busy at the time of your planned meeting"));
        else
@@ -1221,7 +1221,6 @@ static gboolean send_meeting_cb(GtkButton *widget, gpointer data)
        gchar *summary = NULL;
        gchar *description = NULL;
        VCalEvent *event = NULL;
-       gchar buf[256];
        GSList *cur;
        PrefsAccount *account = NULL;
        gboolean res = FALSE;
@@ -1257,22 +1256,10 @@ static gboolean send_meeting_cb(GtkButton *widget, gpointer data)
 
        organizer_name  = get_organizer_name(meet);
 
-       if (account->set_domain && account->domain) {
-               g_snprintf(buf, sizeof(buf), "%s", account->domain); 
-       } else if (!strncmp(get_domain_name(), "localhost", strlen("localhost"))) {
-               g_snprintf(buf, sizeof(buf), "%s", 
-                       strchr(account->address, '@') ?
-                               strchr(account->address, '@')+1 :
-                               account->address);
-       } else {
-               g_snprintf(buf, sizeof(buf), "%s", "");
-       }
-       generate_msgid(buf, 255, account->address);
-
        if (meet->uid) {
                uid     = g_strdup(meet->uid);
        } else {
-               uid     = g_strdup(buf);
+               uid     = prefs_account_generate_msgid(account);
        }
 
        dtstart         = get_date(meet, TRUE);
@@ -1974,7 +1961,7 @@ void multisync_export(void)
                            icalproperty_new_prodid(
                                 "-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
                            icalproperty_new_calscale("GREGORIAN"),
-                           0
+                           (void*)0
                    );  
                vcal_manager_event_dump(event, FALSE, FALSE, calendar, FALSE);
                tmp = g_strconcat(path, G_DIR_SEPARATOR_S, file, NULL);
@@ -2050,7 +2037,7 @@ gboolean vcal_meeting_export_calendar(const gchar *path,
                    icalproperty_new_prodid(
                         "-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
                    icalproperty_new_calscale("GREGORIAN"),
-                   0
+                   (void*)0
             );         
 
        for (cur = list; cur; cur = cur->next) {
@@ -2127,7 +2114,7 @@ putfile:
                        file = tmp;
                }
                if (fp) {
-                       res = vcal_curl_put(file, fp, filesize, user, pass);
+                       res = vcal_curl_put(file, fp, filesize, user, (pass != NULL ? pass : ""));
                        fclose(fp);
                }
                g_free(file);
@@ -2162,7 +2149,7 @@ gboolean vcal_meeting_export_freebusy(const gchar *path, const gchar *user,
                    icalproperty_new_prodid(
                         "-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
                    icalproperty_new_calscale("GREGORIAN"),
-                   0
+                   (void*)0
             );         
 
        timezone = icalcomponent_new(ICAL_VTIMEZONE_COMPONENT);
@@ -2196,7 +2183,7 @@ gboolean vcal_meeting_export_freebusy(const gchar *path, const gchar *user,
                 ICAL_VFREEBUSY_COMPONENT,
                icalproperty_vanew_dtstart(itt_start, 0),
                icalproperty_vanew_dtend(itt_end, 0),
-                0
+                (void*)0
                 );
 
        debug_print("DTSTART:%s\nDTEND:%s\n",
@@ -2275,7 +2262,7 @@ gboolean vcal_meeting_export_freebusy(const gchar *path, const gchar *user,
                        file = tmp;
                }
                if (fp) {
-                       res = vcal_curl_put(file, fp, filesize, user, pass);
+                       res = vcal_curl_put(file, fp, filesize, user, (pass != NULL ? pass : ""));
                        fclose(fp);
                }
                g_free(file);