Skip to contentSkip to conversation

Tools: hv: kvp: fix a build warning -Wformat-security

PATCH New Dexuan Cui 1 participant 1 message Jul 7, 2015 Hyper-V/Azure core and drivers

lore
Share & tools
lore

Dexuan Cui

author maintainer
#0 lore raw

PATCH 1/1 Tools: hv: kvp: fix a build warning -Wformat-security

It is to fix:
hv_kvp_daemon.c:705:2: warning: format not a string literal and no format arguments [-Wformat-security]

---
 tools/hv/hv_kvp_daemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/hv/hv_kvp_daemon.c +1 -1
index 0d9f48e..f9d5089 100644
@@ -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) {
Signature · 1 line
1.9.1