From 7fdcd865f14d5de6a276e71c2ed958a736dc34db Mon Sep 17 00:00:00 2001 From: Peter Michael Green Date: Fri, 19 Jul 2013 18:09:43 +0900 Subject: [PATCH] Fix error with gcc -Wformat -Werror=format-security 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 . --- autogen.sh | 2 +- src/ibusfactory.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/autogen.sh b/autogen.sh index 7b95079..1c82d5f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 "$@" diff --git a/src/ibusfactory.c b/src/ibusfactory.c index 54a94fe..204fc11 100644 --- a/src/ibusfactory.c +++ b/src/ibusfactory.c @@ -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 - * Copyright (C) 2008-2010 Red Hat, Inc. + * Copyright (C) 2008-2013 Peng Huang + * 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; } -- 2.7.4