2010-10-18 [colin] 3.7.6cvs57
authorColin Leroy <colin@colino.net>
Mon, 18 Oct 2010 18:40:32 +0000 (18:40 +0000)
committerColin Leroy <colin@colino.net>
Mon, 18 Oct 2010 18:40:32 +0000 (18:40 +0000)
* src/action.c
* src/addrharvest.c
* src/alertpanel.c
* src/filtering.c
* src/jpilot.c
* src/prefs_themes.c
* src/procmime.c
* src/textview.c
* src/gtk/gtkutils.c
* src/gtk/quicksearch.c
* src/gtk/quicksearch.h
* src/plugins/pgpcore/passphrase.c
* src/plugins/spamassassin/libspamc.c
Fix warnings

16 files changed:
ChangeLog
PATCHSETS
configure.ac
src/action.c
src/addrharvest.c
src/alertpanel.c
src/filtering.c
src/gtk/gtkutils.c
src/gtk/quicksearch.c
src/gtk/quicksearch.h
src/jpilot.c
src/plugins/pgpcore/passphrase.c
src/plugins/spamassassin/libspamc.c
src/prefs_themes.c
src/procmime.c
src/textview.c

index 075de60..ca19d07 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-18 [colin]     3.7.6cvs57
+
+       * src/action.c
+       * src/addrharvest.c
+       * src/alertpanel.c
+       * src/filtering.c
+       * src/jpilot.c
+       * src/prefs_themes.c
+       * src/procmime.c
+       * src/textview.c
+       * src/gtk/gtkutils.c
+       * src/gtk/quicksearch.c
+       * src/gtk/quicksearch.h
+       * src/plugins/pgpcore/passphrase.c
+       * src/plugins/spamassassin/libspamc.c
+               Fix warnings
+
 2010-10-17 [colin]     3.7.6cvs56
 
        * src/prefs_themes.c
index 601d53c..1436607 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.7 -r 1.1.2.8 manual/dist/pdf/Makefile.am;  ) > 3.7.6cvs54.patchset
 ( cvs diff -u -r 1.115.2.230 -r 1.115.2.231 src/main.c;  cvs diff -u -r 1.1.2.69 -r 1.1.2.70 src/gtk/authors.h;  cvs diff -u -r 1.1.2.96 -r 1.1.2.97 src/gtk/quicksearch.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/gtk/quicksearch.h;  ) > 3.7.6cvs55.patchset
 ( cvs diff -u -r 1.3.2.65 -r 1.3.2.66 src/prefs_themes.c;  cvs diff -u -r 1.9.2.68 -r 1.9.2.69 src/gtk/gtkaspell.c;  cvs diff -u -r 1.5.2.91 -r 1.5.2.92 src/gtk/gtkutils.c;  cvs diff -u -r 1.4.2.50 -r 1.4.2.51 src/gtk/gtkutils.h;  cvs diff -u -r 1.2.2.38 -r 1.2.2.39 src/gtk/inputdialog.c;  cvs diff -u -r 1.1.4.25 -r 1.1.4.26 src/gtk/progressdialog.c;  ) > 3.7.6cvs56.patchset
+( cvs diff -u -r 1.12.2.60 -r 1.12.2.61 src/action.c;  cvs diff -u -r 1.6.10.22 -r 1.6.10.23 src/addrharvest.c;  cvs diff -u -r 1.17.2.41 -r 1.17.2.42 src/alertpanel.c;  cvs diff -u -r 1.60.2.54 -r 1.60.2.55 src/filtering.c;  cvs diff -u -r 1.18.2.30 -r 1.18.2.31 src/jpilot.c;  cvs diff -u -r 1.3.2.66 -r 1.3.2.67 src/prefs_themes.c;  cvs diff -u -r 1.49.2.133 -r 1.49.2.134 src/procmime.c;  cvs diff -u -r 1.96.2.224 -r 1.96.2.225 src/textview.c;  cvs diff -u -r 1.5.2.92 -r 1.5.2.93 src/gtk/gtkutils.c;  cvs diff -u -r 1.1.2.97 -r 1.1.2.98 src/gtk/quicksearch.c;  cvs diff -u -r 1.1.2.20 -r 1.1.2.21 src/gtk/quicksearch.h;  cvs diff -u -r 1.1.2.32 -r 1.1.2.33 src/plugins/pgpcore/passphrase.c;  cvs diff -u -r 1.4.2.7 -r 1.4.2.8 src/plugins/spamassassin/libspamc.c;  ) > 3.7.6cvs57.patchset
index ac89abf..108fa4f 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=56
+EXTRA_VERSION=57
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 60655d7..b6b1270 100644 (file)
@@ -947,11 +947,12 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str,
 
        pid = fork();
        if (pid == 0) { /* Child */
+               int r = 0;
                if (setpgid(0, 0))
                        perror("setpgid");
 
 #ifdef GDK_WINDOWING_X11
-               (void)close(ConnectionNumber(gdk_display_get_default()));
+               r = close(ConnectionNumber(gdk_display_get_default()));
 #endif /* GDK_WINDOWING_X11 */
 
                gch_pid = fork();
@@ -965,21 +966,24 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str,
                                    (ACTION_PIPE_IN |
                                     ACTION_USER_IN |
                                     ACTION_USER_HIDDEN_IN)) {
-                                       (void)close(fileno(stdin));
-                                       (void)dup  (chld_in[0]);
+                                       r |= close(fileno(stdin));
+                                       r |= dup  (chld_in[0]);
                                }
-                               (void)close(chld_in[0]);
-                               (void)close(chld_in[1]);
-
-                               (void)close(fileno(stdout));
-                               (void)dup  (chld_out[1]);
-                               (void)close(chld_out[0]);
-                               (void)close(chld_out[1]);
-
-                               (void)close(fileno(stderr));
-                               (void)dup  (chld_err[1]);
-                               (void)close(chld_err[0]);
-                               (void)close(chld_err[1]);
+                               r |= close(chld_in[0]);
+                               r |= close(chld_in[1]);
+
+                               r |= close(fileno(stdout));
+                               r |= dup  (chld_out[1]);
+                               r |= close(chld_out[0]);
+                               r |= close(chld_out[1]);
+
+                               r |= close(fileno(stderr));
+                               r |= dup  (chld_err[1]);
+                               r |= close(chld_err[0]);
+                               r |= close(chld_err[1]);
+
+                               if (r != 0)
+                                       g_warning("%s(%d)", strerror(errno), errno);
                        }
 
                        cmdline[0] = "sh";
@@ -999,24 +1003,29 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str,
                        _exit(1);
                } else if (gch_pid < (pid_t) 0) { /* Fork error */
                        if (sync)
-                               (void)write(chld_status[1], "1\n", 2);
+                               r = write(chld_status[1], "1\n", 2);
+                       if (r != 0)
+                               g_warning("%s(%d)", strerror(errno), errno);
                        perror("fork");
                        _exit(1);
                } else { /* Child */
                        if (sync) {
-                               (void)close(chld_in[0]);
-                               (void)close(chld_in[1]);
-                               (void)close(chld_out[0]);
-                               (void)close(chld_out[1]);
-                               (void)close(chld_err[0]);
-                               (void)close(chld_err[1]);
-                               (void)close(chld_status[0]);
+                               r |= close(chld_in[0]);
+                               r |= close(chld_in[1]);
+                               r |= close(chld_out[0]);
+                               r |= close(chld_out[1]);
+                               r |= close(chld_err[0]);
+                               r |= close(chld_err[1]);
+                               r |= close(chld_status[0]);
 
                                debug_print("Child: waiting for grandchild\n");
-                               waitpid(gch_pid, NULL, 0);
+                               r |= waitpid(gch_pid, NULL, 0);
                                debug_print("Child: grandchild ended\n");
-                               (void)write(chld_status[1], "0\n", 2);
-                               (void)close(chld_status[1]);
+                               r |= write(chld_status[1], "0\n", 2);
+                               r |= close(chld_status[1]);
+
+                               if (r != 0)
+                                       g_warning("%s(%d)", strerror(errno), errno);
                        }
                        _exit(0);
                }
@@ -1068,17 +1077,20 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str,
                return child_info;
 
        if ((children->action_type & ACTION_PIPE_IN) && msg_str) {
+               int r;
                ret_str = g_locale_from_utf8(msg_str, strlen(msg_str),
                                             &by_read, &by_written, NULL);
                if (ret_str && by_written) {
-                       (void)write(chld_in[1], ret_str, strlen(ret_str));
+                       r = write(chld_in[1], ret_str, strlen(ret_str));
                        g_free(ret_str);
                } else
-                       (void)write(chld_in[1], msg_str, strlen(msg_str));
+                       r = write(chld_in[1], msg_str, strlen(msg_str));
                if (!(children->action_type &
                      (ACTION_USER_IN | ACTION_USER_HIDDEN_IN)))
-                       (void)close(chld_in[1]);
+                       r = close(chld_in[1]);
                child_info->chld_in = -1; /* No more input */
+               if (r != 0)
+                       g_warning("%s(%d)", strerror(errno), errno);
        }
 
        return child_info;
@@ -1499,7 +1511,7 @@ static void catch_input(gpointer data, gint source, GdkInputCondition cond)
        Children *children = (Children *)data;
        ChildInfo *child_info = (ChildInfo *)children->list->data;
        gchar *input, *ret_str;
-       gint c, count, len;
+       gint c, count, len, r;
        gssize by_read = 0, by_written = 0;
 
        debug_print("Sending input to grand child.\n");
@@ -1531,11 +1543,13 @@ static void catch_input(gpointer data, gint source, GdkInputCondition cond)
        } while (c >= 0 && count < len);
 
        if (c >= 0)
-               (void)write(child_info->chld_in, "\n", 2);
+               r = write(child_info->chld_in, "\n", 2);
 
        g_free(input);
 
-       (void)close(child_info->chld_in);
+       r = close(child_info->chld_in);
+       if (r != 0)
+               g_warning("%s(%d)", strerror(errno), errno);
        child_info->chld_in = -1;
        debug_print("Input to grand child sent.\n");
 }
index 8cb51ef..02919f5 100644 (file)
@@ -712,14 +712,15 @@ static void addrharvest_harvest_dir(
        struct dirent *d;
        struct stat s;
        gint num;
+       int r;
 
        if( ( dp = opendir( dir ) ) == NULL ) {
                return;
        }
 
        /* Process directory */
-       chdir( dir );
-       while( ( d = readdir( dp ) ) != NULL ) {
+       r = chdir( dir );
+       while( r == 0 && ( d = readdir( dp ) ) != NULL ) {
                g_stat( d->d_name, &s );
                if( S_ISDIR( s.st_mode ) ) {
                        if( harvester->folderRecurse ) {
@@ -736,7 +737,7 @@ static void addrharvest_harvest_dir(
                        }
                }
        }
-       chdir( ".." );
+       r = chdir( ".." );
        closedir( dp );
 }
 
@@ -754,13 +755,14 @@ static void addrharvest_harvest_list(
        gint num;
        GList *node;
        gchar msgNum[ MSGNUM_BUFFSIZE ];
+       int r;
 
        if( ( dp = opendir( harvester->path ) ) == NULL ) {
                return;
        }
 
        /* Process message list */
-       chdir( harvester->path );
+       r = chdir( harvester->path );
        node = msgList;
        while( node ) {
                num = GPOINTER_TO_UINT( node->data );
index a30884f..1c3ac2c 100644 (file)
@@ -256,7 +256,6 @@ static void alertpanel_create(const gchar *title,
        gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
 
        gtk_window_set_default_size(GTK_WINDOW(dialog), 375, 100);
-       gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
        
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
        g_signal_connect(G_OBJECT(dialog), "delete_event",
index ffc7dbf..fe76665 100644 (file)
@@ -424,7 +424,8 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info)
                if (cmd == NULL)
                        return FALSE;
                else {
-                       system(cmd);
+                       if (system(cmd) == -1)
+                               g_warning("couldn't run %s", cmd);
                        g_free(cmd);
                }
                return TRUE;
index 4fa559b..1edd76a 100644 (file)
@@ -1073,7 +1073,6 @@ GtkWidget *xface_get_from_header(const gchar *o_xface, GdkColor *background,
 {
        static gchar *xpm_xface[XPM_XFACE_HEIGHT];
        static gboolean xpm_xface_init = TRUE;
-       GdkBitmap *mask;
        gchar xface[2048];
        strncpy(xface, o_xface, sizeof(xface));
 
index 5600f18..123a47d 100644 (file)
@@ -1604,16 +1604,6 @@ void search_msgs_in_folders(GSList **messages, QuickSearch* quicksearch,
        *messages = g_slist_reverse(*messages);
 }
 
-/*
-static void search_msg_folder(GSList **messages, QuickSearch* quicksearch,
-                                                         QuickSearchType searchType,
-                                                         Folder* folder)
-{
-  search_msgs_in_folders(messages, quicksearch, searchType,
-                        FOLDER_ITEM(folder->node->data), TRUE);
-}
-*/
-
  /*
   * Returns the QuickSearchType associated to the supplied string.
   */
index 5adc53a..4096c5c 100644 (file)
@@ -37,8 +37,6 @@ typedef void (*QuickSearchExecuteCallback) (QuickSearch *quicksearch, gpointer d
 
 #include "procmsg.h"
 
-void search_msgs_in_folder(GSList **messages, QuickSearch* quicksearch,
-                          FolderItem* folderItem);
 void search_msgs_in_folders(GSList **messages, QuickSearch* quicksearch,
                            FolderItem* folderItem);
 QuickSearchType quicksearch_type(const gchar *type);
index 913beff..d1d287e 100644 (file)
@@ -535,9 +535,10 @@ static int jpilot_get_info_size( FILE *in, int *size ) {
        DBHeader dbh;
        unsigned int offset;
        record_header rh;
+       int r;
 
        fseek(in, 0, SEEK_SET);
-       fread(&rdbh, sizeof(RawDBHeader), 1, in);
+       r = fread(&rdbh, sizeof(RawDBHeader), 1, in);
        if (feof(in)) {
                return MGU_EOF;
        }
@@ -557,7 +558,7 @@ static int jpilot_get_info_size( FILE *in, int *size ) {
                return MGU_SUCCESS;
        }
 
-       fread(&rh, sizeof(record_header), 1, in);
+       r = fread(&rh, sizeof(record_header), 1, in);
        offset = ((rh.Offset[0]*256+rh.Offset[1])*256+rh.Offset[2])*256+rh.Offset[3];
        *size=offset - dbh.app_info_offset;
 
index c348f6b..a094718 100644 (file)
@@ -319,7 +319,9 @@ gpgmegtk_passphrase_cb(void *opaque, const char *uid_hint,
        gpgmegtk_free_passphrase();
        if (!pass) {
             debug_print ("%% cancel passphrase entry\n");
-            write(fd, "\n", 1);
+            if (write(fd, "\n", 1) != 1)
+               debug_print("short write");
+
             return GPG_ERR_CANCELED;
        }
        else {
@@ -347,8 +349,11 @@ gpgmegtk_passphrase_cb(void *opaque, const char *uid_hint,
         WriteFile ((HANDLE)fd, "\n", 1, &nwritten, NULL);
     }
 #else
-    write(fd, pass, strlen(pass));
-    write(fd, "\n", 1);
+    if (write(fd, pass, strlen(pass)) != strlen(pass))
+       debug_print("Short write");
+
+    if (write(fd, "\n", 1) != 1)
+       debug_print("Short write");
 #endif
     g_free(pass);
 
index dca8cda..0aca884 100644 (file)
@@ -1309,8 +1309,8 @@ libspamc_log (int flags, int level, char *msg, ...)
 
         len += snprintf(buf+len, LOG_BUFSIZ-len, "\n");
         buf[LOG_BUFSIZ] = '\0';     /* ensure termination */
-        (void) write (2, buf, len);
-
+        if (write (2, buf, len) != len)
+               goto out;
     } else {
         vsnprintf(buf, LOG_BUFSIZ, msg, ap);
         buf[LOG_BUFSIZ] = '\0';     /* ensure termination */
@@ -1321,7 +1321,7 @@ libspamc_log (int flags, int level, char *msg, ...)
         g_printerr ("%s\n", buf);
 #endif
     }
-
+out:
     va_end(ap);
 }
 
index 1f52f67..2b4e24a 100644 (file)
@@ -698,8 +698,7 @@ static void prefs_themes_display_global_stats(const ThemesData *tdata)
 
 #define FGETS_INFOFILE_LINE() \
        line[0] = '\0'; \
-       fgets(line, INFOFILE_LINE_LEN, finfo); \
-       if ((len = strlen(line)) > 0) { \
+       if (fgets(line, INFOFILE_LINE_LEN, finfo) != NULL && (len = strlen(line)) > 0) { \
                if (line[len - 1] == '\n') line[len - 1] = '\0'; \
        } \
        else { \
index 88b9c18..b325797 100644 (file)
@@ -2243,7 +2243,11 @@ static void write_parameters(gpointer key, gpointer value, gpointer user_data)
                                g_string_append_printf(buf, "%%%s", hexstr);
                        }
                }
-               break;          
+               break;
+#else
+       case ENC_AS_EXTENDED:
+               debug_print("Unhandled ENC_AS_EXTENDED.");
+               break;
 #endif
        case ENC_AS_ENCWORD:
                len = MAX(strlen(val)*6, 512);
index 077885b..7629034 100644 (file)
@@ -1018,7 +1018,7 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
                        argv = strsplit_with_quote(buf, " ", 0);
                        close(1);
                        close(pfd[0]);
-                       dup(pfd[1]);
+                       rc = dup(pfd[1]);
                        rc = execvp(argv[0], argv);
                        close(pfd[1]);
                        g_print(_("The command to view attachment "