Fix error with gcc -Wformat -Werror=format-security
authorPeter Michael Green <plugwash@debian.org>
Fri, 19 Jul 2013 09:09:43 +0000 (18:09 +0900)
committerfujiwarat <takao.fujiwara1@gmail.com>
Fri, 19 Jul 2013 09:09:43 +0000 (18:09 +0900)
BUG=http://code.google.com/p/ibus/issues/detail?id=1638
TEST=src/ibusfactory.c

Review URL: https://codereview.appspot.com/11503043
Patch from Peter Michael Green <plugwash@debian.org>.

autogen.sh
src/ibusfactory.c

index 7b95079..1c82d5f 100755 (executable)
@@ -22,7 +22,7 @@ which gnome-autogen.sh || {
     touch $srcdir/ChangeLog
 }
 
-CFLAGS=${CFLAGS-"-Wall -Werror"}
+CFLAGS=${CFLAGS-"-Wall -Werror -Wformat -Werror=format-security"}
 
 # need --enable-gtk-doc for gnome-autogen.sh to make dist
 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" REQUIRED_AUTOMAKE_VERSION=1.11 CFLAGS="$CFLAGS" . gnome-autogen.sh "$@"
index 54a94fe..204fc11 100644 (file)
@@ -1,8 +1,8 @@
 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
 /* vim:set et sts=4: */
 /* ibus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2008-2010 Red Hat, Inc.
+ * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
+ * Copyright (C) 2008-2013 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -287,12 +287,11 @@ ibus_factory_service_method_call (IBusService           *service,
             g_free (object_path);
         }
         else {
-            gchar *error_message = g_strdup_printf ("Can not fond engine %s", engine_name);
             g_dbus_method_invocation_return_error (invocation,
                                                    G_DBUS_ERROR,
                                                    G_DBUS_ERROR_FAILED,
-                                                   error_message);
-            g_free (error_message);
+                                                   "Can not fond engine %s",
+                                                   engine_name);
         }
         return;
     }