* src/addrbook.c
authorMelvin Hadasht <melvin.hadasht@free.fr>
Sat, 13 Jul 2002 11:20:49 +0000 (11:20 +0000)
committerMelvin Hadasht <melvin.hadasht@free.fr>
Sat, 13 Jul 2002 11:20:49 +0000 (11:20 +0000)
* src/addressbook.c
* src/addrindex.c
Replaced sprintf by g_snprintf to prevent possible buffer
overflow.
* src/news.c
Corrected a log message output format.
Added a missing "done" debug output.
* src/compose.c
Added keyboard accelerator for Priority menu items
Added missing \n in debug output
* src/logwindow.c
* src/gtkspell.c
* src/rfc2015.c
Added missing \n in debug output

ChangeLog.claws
configure.in
src/addrbook.c
src/addressbook.c
src/addrindex.c
src/compose.c
src/gtkspell.c
src/logwindow.c
src/news.c
src/rfc2015.c

index 6e72d8e7c876cff3839206a6dc039011991bc40d..a04f475df9c2c39577225a46a804a586c1061fa3 100644 (file)
@@ -1,3 +1,21 @@
+2002-07-09 [melvin]    0.7.8claws65
+       
+       * src/addrbook.c
+       * src/addressbook.c
+       * src/addrindex.c
+               Replaced sprintf by g_snprintf to prevent possible buffer
+               overflow.
+       * src/news.c
+               Corrected a log message output format.
+               Added a missing "done" debug output.
+       * src/compose.c
+               Added keyboard accelerator for Priority menu items
+               Added missing \n in debug output
+       * src/logwindow.c
+       * src/gtkspell.c
+       * src/rfc2015.c
+               Added missing \n in debug output
+
 2002-07-13 [paul]      0.7.8claws64
 
        * man/sylpheed.1
@@ -78,7 +96,7 @@
                changed calls from gtk_ctree_sort_recursive() and gtk_ctree_sort_node()
                to gtk_sctree_sort_recursive() and gtk_sctree_sort_node()
 
-2002-07-08     [paul]  0.7.8claws55
+2002-07-08 [paul]      0.7.8claws55
 
        * more sync with 0.7.8cvs21
                see ChangeLog 2002-07-08
index 897fab05baf07ab7fc4fea23b19925c3d0929477..c9a9dfab03d392c66a7917e78c8e073ffaf390f8 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws64
+EXTRA_VERSION=claws65
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index dcdad5c7bfeb3df12b5b0ee883aa774ba9203c76..b51ad901704544643627019773e763af87ddce72 100644 (file)
@@ -1709,8 +1709,8 @@ gchar *addrbook_gen_new_file_name( gint fileNum ) {
        if( n < 1 ) n = 1;
        nmax = -1 + (long int) pow( 10, FILE_NUMDIGITS );
        if( fileNum > nmax ) return NULL;
-       sprintf( fmt, "%%s%%0%dd%%s", FILE_NUMDIGITS );
-       sprintf( buf, fmt, ADDRBOOK_PREFIX, n, ADDRBOOK_SUFFIX );
+       g_snprintf( fmt, sizeof(fmt), "%%s%%0%dd%%s", FILE_NUMDIGITS );
+       g_snprintf( buf, sizeof(buf), fmt, ADDRBOOK_PREFIX, n, ADDRBOOK_SUFFIX );
        return g_strdup( buf );
 }
 
index bb1073088be597c87e3ff804809dab755f64a4b6..e894a0010c9977a5c5dd76848d07e448d9a6ade7 100644 (file)
@@ -803,10 +803,12 @@ static void addressbook_ds_status_message( AddressDataSource *ds, gchar *msg ) {
                gchar *name;
 
                name = addrindex_ds_get_name( ds );
-               sprintf( addressbook_msgbuf, "%s: %s", name, msg );
+               g_snprintf( addressbook_msgbuf, sizeof(addressbook_msgbuf),
+                           "%s: %s", name, msg );
        }
        else {
-               sprintf( addressbook_msgbuf, "%s", msg );
+               g_snprintf( addressbook_msgbuf, sizeof(addressbook_msgbuf),
+                           "%s", msg );
        }
        addressbook_status_show( addressbook_msgbuf );
 }
@@ -819,11 +821,13 @@ static void addressbook_ds_show_message( AddressDataSource *ds ) {
                name = addrindex_ds_get_name( ds );
                retVal = addrindex_ds_get_status_code( ds );
                if( retVal == MGU_SUCCESS ) {
-                       sprintf( addressbook_msgbuf, "%s", name );
+                       g_snprintf( addressbook_msgbuf,
+                                   sizeof(addressbook_msgbuf), "%s", name );
                }
                else {
-                       sprintf( addressbook_msgbuf, "%s: %s", name,
-                               mgu_error2string( retVal ) );
+                       g_snprintf( addressbook_msgbuf, 
+                                   sizeof(addressbook_msgbuf), "%s: %s", name,
+                                   mgu_error2string( retVal ) );
                }
        }
        addressbook_status_show( addressbook_msgbuf );
@@ -3182,14 +3186,21 @@ static void addressbook_ldap_show_message( SyldapServer *svr ) {
        if( svr ) {
                name = syldap_get_name( svr );
                if( svr->busyFlag ) {
-                       sprintf( addressbook_msgbuf, "%s: %s", name, ADDRESSBOOK_LDAP_BUSYMSG );
+                       g_snprintf( addressbook_msgbuf,
+                                   sizeof(addressbook_msgbuf), "%s: %s", name,
+                                   ADDRESSBOOK_LDAP_BUSYMSG );
                }
                else {
                        if( svr->retVal == MGU_SUCCESS ) {
-                               sprintf( addressbook_msgbuf, "%s", name );
+                               g_snprintf( addressbook_msgbuf,
+                                           sizeof(addressbook_msgbuf), "%s",
+                                           name );
                        }
                        else {
-                               sprintf( addressbook_msgbuf, "%s: %s", name, mgu_error2string( svr->retVal ) );
+                               g_snprintf( addressbook_msgbuf,
+                                           sizeof(addressbook_msgbuf),
+                                           "%s: %s", name,
+                                           mgu_error2string( svr->retVal ) );
                        }
                }
        }
index 0dbc3edc7cb58f400db35e24c0df0a3d654843e2..141c5141ef58fc1674535f3baed7edc940543c10 100644 (file)
@@ -907,7 +907,8 @@ static void addrindex_write_jpilot( FILE *fp,AddressDataSource *ds, gint lvl ) {
                ind = 1;
                while( node ) {
                        gchar name[256];
-                       sprintf( name, "%s%d", ATTAG_JPILOT_CUSTOM, ind );
+                       g_snprintf( name, sizeof(name), "%s%d",
+                                   ATTAG_JPILOT_CUSTOM, ind );
                        addrindex_write_attr( fp, name, node->data );
                        ind++;
                        node = g_list_next( node );
index fd686887c20a7d0a70175917f35632bef087ee01..4af936012733a54f37531c0eda6b3f12b946e36a 100644 (file)
@@ -650,12 +650,12 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Message/_Encrypt"),      NULL, compose_toggle_encrypt_cb, 0, "<ToggleItem>"},
 #endif /* USE_GPGME */
        {N_("/_Message/---"),           NULL,           NULL,   0, "<Separator>"},
-       {N_("/_Message/Priority"),      NULL,           NULL,   0, "<Branch>"},
-       {N_("/_Message/Priority/Highest"), NULL, compose_set_priority_cb, PRIORITY_HIGHEST, "<RadioItem>"},
-       {N_("/_Message/Priority/High"),    NULL, compose_set_priority_cb, PRIORITY_HIGH, "/Message/Priority/Highest"},
-       {N_("/_Message/Priority/Normal"),  NULL, compose_set_priority_cb, PRIORITY_NORMAL, "/Message/Priority/Highest"},
-       {N_("/_Message/Priority/Low"),     NULL, compose_set_priority_cb, PRIORITY_LOW, "/Message/Priority/Highest"},
-       {N_("/_Message/Priority/Lowest"),  NULL, compose_set_priority_cb, PRIORITY_LOWEST, "/Message/Priority/Highest"},
+       {N_("/_Message/_Priority"),     NULL,           NULL,   0, "<Branch>"},
+       {N_("/_Message/Priority/_Highest"), NULL, compose_set_priority_cb, PRIORITY_HIGHEST, "<RadioItem>"},
+       {N_("/_Message/Priority/Hi_gh"),    NULL, compose_set_priority_cb, PRIORITY_HIGH, "/Message/Priority/Highest"},
+       {N_("/_Message/Priority/_Normal"),  NULL, compose_set_priority_cb, PRIORITY_NORMAL, "/Message/Priority/Highest"},
+       {N_("/_Message/Priority/Lo_w"),    NULL, compose_set_priority_cb, PRIORITY_LOW, "/Message/Priority/Highest"},
+       {N_("/_Message/Priority/_Lowest"),  NULL, compose_set_priority_cb, PRIORITY_LOWEST, "/Message/Priority/Highest"},
        {N_("/_Message/---"),           NULL,           NULL,   0, "<Separator>"},
        {N_("/_Message/_Request Return Receipt"),       NULL, compose_toggle_return_receipt_cb, 0, "<ToggleItem>"},
        {N_("/_Tools"),                 NULL, NULL, 0, "<Branch>"},
@@ -4663,7 +4663,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                        GtkWidget *menuitem;
 
                        if (!gtkpspell_set_sug_mode(gtkpspell, prefs_common.pspell_sugmode)) {
-                               debug_print(_("Pspell: could not set suggestion mode %s"),
+                               debug_print(_("Pspell: could not set suggestion mode %s\n"),
                                    gtkpspellcheckers->error_message);
                                gtkpspell_checkers_reset_error();
                        }
index 3df1acfa85f05920dbddb20f2cb3730ddbaa5dfc..7b9f17efbecb8724a50a4f96ce74f78a73847678 100644 (file)
@@ -1543,7 +1543,7 @@ GSList *gtkpspell_get_dictionary_list(const gchar *pspell_path, gint refresh)
        }
         if(list==NULL){
                
-               debug_print(_("Pspell: error when searching for dictionaries.\nNo dictionary found."));
+               debug_print(_("Pspell: error when searching for dictionaries.\nNo dictionary found.\n"));
                list = create_empty_dictionary_list();
        }
 
index d6acdf15384b45505fa9f220432be7773227699f..56356182648769de6394057c8c2e250c50fb927d 100644 (file)
@@ -167,7 +167,7 @@ void log_window_clear(GtkWidget *text)
        gchar *str;
        
        length = gtk_text_get_length (GTK_TEXT (text));
-       debug_print(_("Log window length: %u"), length);
+       debug_print(_("Log window length: %u\n"), length);
        
        if (length > prefs_common.loglength) {
                /* find the end of the first line after the cut off
@@ -184,7 +184,7 @@ void log_window_clear(GtkWidget *text)
                /* erase the text */
                gtk_text_set_point (GTK_TEXT (text), 0);
                if (!gtk_text_forward_delete (GTK_TEXT (text), point + 1))
-                       debug_print (_("Error clearing log"));
+                       debug_print (_("Error clearing log\n"));
                gtk_text_thaw (GTK_TEXT (text));
                gtk_text_set_point (GTK_TEXT (text),
                                    gtk_text_get_length (GTK_TEXT (text)));
index 7347b83ac4c369d492fcbf365c4d1684622a7829..f1d33847bf2c8c0b6d70a00c728925741b7aa68a 100644 (file)
@@ -947,6 +947,7 @@ static GSList *news_delete_old_articles(GSList *alist, FolderItem *item,
 
                cur = next;
        }
+       debug_print(_("done.\n"));
 
        return alist;
 }
@@ -1043,7 +1044,7 @@ GSList *news_get_num_list(Folder *folder, FolderItem *item)
 #define READ_TO_LISTEND(hdr) \
        while (!(buf[0] == '.' && buf[1] == '\r')) { \
                if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) { \
-                       log_warning(_("error occurred while getting " hdr ".\n")); \
+                       log_warning(_("error occurred while getting %s.\n"), hdr); \
                        return msginfo; \
                } \
        }
index 7c0c3772be25dbc004d2b12ded01c53ba7201fb0..58cf3a14d8854d791054b636442ff249fd8c5899 100644 (file)
@@ -417,7 +417,7 @@ leave:
         plain = NULL;
     }
     else
-        debug_print ("** decryption succeeded");
+        debug_print ("** decryption succeeded\n");
 
     gpgme_release (ctx);
     return plain;
@@ -433,7 +433,7 @@ MimeInfo * rfc2015_find_signature (MimeInfo *mimeinfo)
     if (g_strcasecmp (mimeinfo->content_type, "multipart/signed"))
         return NULL;
 
-    debug_print ("** multipart/signed encountered");
+    debug_print ("** multipart/signed encountered\n");
 
     /* check that we have at least 2 parts of the correct type */
     for (partinfo = mimeinfo->children;
@@ -565,7 +565,7 @@ void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
     g_return_if_fail (fp != NULL);
     g_return_if_fail (mimeinfo->mime_type == MIME_MULTIPART);
 
-    debug_print ("** decrypting multipart/encrypted message");
+    debug_print ("** decrypting multipart/encrypted message\n");
 
     /* skip headers */
     if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0)
@@ -596,7 +596,7 @@ void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
         DECRYPTION_ABORT();
     }
 
-    debug_print ("** yep, it is pgp encrypted");
+    debug_print ("** yep, it is pgp encrypted\n");
 
     plain = pgp_decrypt (partinfo, fp);
     if (!plain) {
@@ -672,7 +672,7 @@ pgp_encrypt ( GpgmeData plain, GpgmeRecipients rset )
         cipher = NULL;
     }
     else {
-        debug_print ("** encryption succeeded");
+        debug_print ("** encryption succeeded\n");
     }
 
     gpgme_release (ctx);