mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Weibing Zhang <atheism.zhang@gmail.com>
To: kys@microsoft.com, haiyangz@microsoft.com
Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
	Weibing Zhang <atheism.zhang@gmail.com>
Subject: [PATCH 2/3] tools: hv: fix a compile warning in snprintf
Date: Wed, 19 Oct 2016 18:06:48 +0800	[thread overview]
Message-ID: <1476871609-9245-2-git-send-email-atheism.zhang@gmail.com> (raw)
In-Reply-To: <1476871609-9245-1-git-send-email-atheism.zhang@gmail.com>

hv_kvp_daemon.c: In function ‘kvp_mac_to_if_name’:
hv_kvp_daemon.c:705:2: warning: format not a string literal and no format arguments [-Wformat-security]
  snprintf(dev_id, sizeof(dev_id), kvp_net_dir);
  ^
hv_kvp_daemon.c:705:2: warning: format not a string literal and no format arguments [-Wformat-security]

Signed-off-by: Weibing Zhang <atheism.zhang@gmail.com>
---
 tools/hv/hv_kvp_daemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index bc7adb8..bb0719b 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -702,7 +702,7 @@ static char *kvp_mac_to_if_name(char *mac)
 	if (dir == NULL)
 		return NULL;
 
-	snprintf(dev_id, sizeof(dev_id), kvp_net_dir);
+	snprintf(dev_id, sizeof(dev_id), "%s", kvp_net_dir);
 	q = dev_id + strlen(kvp_net_dir);
 
 	while ((entry = readdir(dir)) != NULL) {
-- 
2.7.4

  reply	other threads:[~2016-10-19 14:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19 10:06 [PATCH 1/3] tools: hv: remove unnecessary link flag Weibing Zhang
2016-10-19 10:06 ` Weibing Zhang [this message]
2016-10-19 10:06 ` [PATCH 3/3] tools: hv: remove unnecessary header files and netlink related code Weibing Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476871609-9245-2-git-send-email-atheism.zhang@gmail.com \
    --to=atheism.zhang@gmail.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome