[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-167-g9a7649aac

wwp at claws-mail.org wwp at claws-mail.org
Sun Sep 12 13:54:21 CEST 2021


The branch, gtk3 has been updated
       via  9a7649aac85f5bf38f92236e5609de0c547a18e7 (commit)
      from  24415eb70d1e92081ca8013fafb78679e4e2025f (commit)

Summary of changes:
 src/import.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
commit 9a7649aac85f5bf38f92236e5609de0c547a18e7
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 6553700c5..00f7b1615 100644
--- a/src/import.c
+++ b/src/import.c
@@ -194,13 +194,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 (!*destdir) {
+		if (alertpanel(_("Import mbox file"),
+						_("Destination folder is not set.\nImport mbox file to the Inbox folder?"),
 						_("_OK"), _("_Cancel"), NULL, ALERTFOCUS_FIRST)
 			== G_ALERTALTERNATE) {
 			gtk_widget_grab_focus(dest_entry);
@@ -214,11 +218,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