gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gluster-devel] [PATCH 1/2] glusterfsd: fix two GCC warnings on format s


From: Liu Yuan
Subject: [Gluster-devel] [PATCH 1/2] glusterfsd: fix two GCC warnings on format string
Date: Tue, 13 Nov 2012 19:39:11 +0800

From: Liu Yuan <address@hidden>

With GCC 4.6.3, following warning is reported

warning: format not a string literal and no format arguments [-Wformat-security]

In function 'glusterd_op_set_volume' and 'glusterd_op_stage_replace_brick'.

This patch adds "%s" explicitly to these two call site of gf_log().

Signed-off-by: Liu Yuan <address@hidden>
---
 xlators/mgmt/glusterd/src/glusterd-op-sm.c         |    2 +-
 xlators/mgmt/glusterd/src/glusterd-replace-brick.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c 
b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 40f38f5..a269d2d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1165,7 +1165,7 @@ glusterd_op_set_volume (dict_t *dict)
                 if (ret) {
                         op_errstr = (op_errstr)? op_errstr:
                                      "Volume set help internal error";
-                        gf_log (this->name, GF_LOG_ERROR, op_errstr);
+                        gf_log (this->name, GF_LOG_ERROR, "%s", op_errstr);
                 }
                 goto out;
          }
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c 
b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index edc2627..0ca8da6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -432,7 +432,7 @@ glusterd_op_stage_replace_brick (dict_t *dict, char 
**op_errstr,
         if (ret) {
                 *op_errstr = gf_strdup (msg);
                 ret = -1;
-                gf_log (THIS->name, GF_LOG_ERROR, *op_errstr);
+                gf_log (THIS->name, GF_LOG_ERROR, "%s", *op_errstr);
                 goto out;
         }
 
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]