Browse Source

tools: hv: fix a compile warning in snprintf

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>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Weibing Zhang 8 years ago
parent
commit
1745ba4194
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/hv/hv_kvp_daemon.c

+ 1 - 1
tools/hv/hv_kvp_daemon.c

@@ -702,7 +702,7 @@ static char *kvp_mac_to_if_name(char *mac)
 	if (dir == NULL)
 	if (dir == NULL)
 		return 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);
 	q = dev_id + strlen(kvp_net_dir);
 
 
 	while ((entry = readdir(dir)) != NULL) {
 	while ((entry = readdir(dir)) != NULL) {