Fix build with hardened compiler flags
authorRicardo Mones <ricardo@mones.org>
Thu, 9 Jul 2015 01:14:56 +0000 (03:14 +0200)
committerRicardo Mones <ricardo@mones.org>
Thu, 9 Jul 2015 01:17:16 +0000 (03:17 +0200)
Error was:
compose.c: In function 'compose_write_to_file':
compose.c:5782:5: error: format not a string literal and no format
arguments [-Werror=format-security]
     alertpanel_error(msg);
     ^
cc1: some warnings being treated as errors
Makefile:1430: recipe for target 'compose.o' failed
make[6]: *** [compose.o] Error 1

src/compose.c

index 149eae99a10d0880036e05f552ea57de10995054..4a6b5c0d4820b1c90f42429fe5f988cddf26322c 100644 (file)
@@ -5777,10 +5777,8 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool
                        if (!privacy_encrypt(compose->privacy_system, mimemsg, compose->encdata)) {
                                debug_print("Couldn't encrypt mime structure: %s.\n",
                                                privacy_get_error());
                        if (!privacy_encrypt(compose->privacy_system, mimemsg, compose->encdata)) {
                                debug_print("Couldn't encrypt mime structure: %s.\n",
                                                privacy_get_error());
-                               msg = g_strdup_printf("Couldn't encrypt the email: %s",
+                               alertpanel_error(_("Couldn't encrypt the email: %s"),
                                                privacy_get_error());
                                                privacy_get_error());
-                               alertpanel_error(msg);
-                               g_free(msg);
                        }
                }
        }
                        }
                }
        }