sync with 0.8.1cvs12
[claws.git] / src / compose.c
index 075469b7d93f47f5cb889887c6e6d45083592d74..f8bf9678642e31c8fa5dc742208a1e88c7fa361f 100644 (file)
@@ -2400,7 +2400,7 @@ static void compose_wrap_line_all(Compose *compose)
                /* we have encountered line break */
                if (ch_len == 1 && *cbuf == '\n') {
                        gint clen;
-                       gchar cb[MB_CUR_MAX];
+                       gchar cb[MB_LEN_MAX];
 
                        /* should we join the next line */
                        if ((i_len != cur_len) && do_delete &&
@@ -3042,40 +3042,36 @@ static gint compose_redirect_write_to_file(Compose *compose, const gchar *file)
 }
 
 
-#ifdef USE_GPGME
-/*
- * interfaces to rfc2015 to keep out the prefs stuff there.
+#if USE_GPGME
+/* interfaces to rfc2015 to keep out the prefs stuff there.
  * returns 0 on success and -1 on error. */
-static int compose_create_signers_list (Compose *compose, GSList **pkey_list)
+static gint compose_create_signers_list(Compose *compose, GSList **pkey_list)
 {
-       const char *keyid = NULL;
+       const gchar *key_id = NULL;
        GSList *key_list;
 
        switch (compose->account->sign_key) {
        case SIGN_KEY_DEFAULT:
                *pkey_list = NULL;
-               return 0;               /* nothing to do */
-
+               return 0;
        case SIGN_KEY_BY_FROM:
-               keyid = compose->account->address;
+               key_id = compose->account->address;
                break;
-
        case SIGN_KEY_CUSTOM:
-               keyid = compose->account->sign_key_id;
+               key_id = compose->account->sign_key_id;
                break;
-
        default:
-               g_assert_not_reached ();
+               break;
        }
 
-       key_list = rfc2015_create_signers_list(keyid);
+       key_list = rfc2015_create_signers_list(key_id);
 
        if (!key_list) {
-           alertpanel_error("Could not find any key associated with currently "
-                               "selected keyid `%s'!", keyid);
-           return -1;
+               alertpanel_error(_("Could not find any key associated with "
+                                  "currently selected key id `%s'."), key_id);
+               return -1;
        }
-       
+
        *pkey_list = key_list;
        return 0;
 }
@@ -3206,16 +3202,16 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
 #if USE_GPGME
        if (compose->use_signing) {
                GSList *key_list;
-               
-               if (compose_create_signers_list(compose, &key_list) == -1 ||
-                       rfc2015_sign(file, key_list) < 0) {
-                   
+
+               if (compose_create_signers_list(compose, &key_list) < 0 ||
+                   rfc2015_sign(file, key_list) < 0) {
                        unlink(file);
                        return -1;
                }
        }
        if (compose->use_encryption) {
-               if (rfc2015_encrypt(file, compose->to_list, compose->account->ascii_armored) < 0) {
+               if (rfc2015_encrypt(file, compose->to_list,
+                                   compose->account->ascii_armored) < 0) {
                        unlink(file);
                        return -1;
                }