[Commits] [SCM] claws branch, master, updated. 3.18.0-114-gfe2c6b9d2

wwp at claws-mail.org wwp at claws-mail.org
Sun Sep 12 13:56:04 CEST 2021


The branch, master has been updated
       via  fe2c6b9d2f8abed0b997cda34618b70e57cc4b5f (commit)
      from  fa8b9e14d9f3452e48737ef1170858407f1b3226 (commit)

Summary of changes:
 src/import.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit fe2c6b9d2f8abed0b997cda34618b70e57cc4b5f
Author: wwp <subscript at free.fr>
Date:   Sun Sep 12 13:53:05 2021 +0200

    Fix CID 141151: coverity scared because we're testing of pointers that can
    never be null (from gtk_entry_get_text()).

diff --git a/src/import.c b/src/import.c
index 23d4be959..cc6224e33 100644
--- a/src/import.c
+++ b/src/import.c
@@ -200,13 +200,17 @@ static void import_ok_cb(GtkWidget *widget, gpointer data)
 	utf8mbox = gtk_entry_get_text(GTK_ENTRY(file_entry));
 	destdir = gtk_entry_get_text(GTK_ENTRY(dest_entry));
 
-	if (utf8mbox && !*utf8mbox) {
+	cm_return_if_fail(utf8mbox);
+	cm_return_if_fail(destdir);
+
+	if (!*utf8mbox) {
 		alertpanel_error(_("Source mbox filename can't be left empty."));
 		gtk_widget_grab_focus(file_entry);
 		return;
 	}
 	if (destdir && !*destdir) {
-		if (alertpanel(_("Import mbox file"), _("Destination folder is not set.\nImport mbox file to the Inbox folder?"),
+		if (alertpanel(_("Import mbox file"),
+						_("Destination folder is not set.\nImport mbox file to the Inbox folder?"),
 						GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL, ALERTFOCUS_FIRST)
 			== G_ALERTALTERNATE) {
 			gtk_widget_grab_focus(dest_entry);
@@ -220,11 +224,10 @@ static void import_ok_cb(GtkWidget *widget, gpointer data)
 		mbox = g_strdup(utf8mbox);
 	}
 
-	if (!destdir || !*destdir) {
+	if (!*destdir) {
 		dest = folder_find_item_from_path(INBOX_DIR);
 	} else {
-		dest = folder_find_item_from_identifier
-			(destdir);
+		dest = folder_find_item_from_identifier(destdir);
 	}
 
 	if (!dest) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list