mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-15 18:05:49 +00:00
kvm-tools: remove unneed sprintf("%s")
it makes no sense. Acked-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
898b234833
commit
da08dcdb09
+1
-3
@@ -99,12 +99,10 @@ static int kvm_list_running_instances(void)
|
||||
|
||||
static int kvm_list_rootfs(void)
|
||||
{
|
||||
char name[PATH_MAX];
|
||||
DIR *dir;
|
||||
struct dirent *dirent;
|
||||
|
||||
snprintf(name, PATH_MAX, "%s", kvm__get_dir());
|
||||
dir = opendir(name);
|
||||
dir = opendir(kvm__get_dir());
|
||||
if (dir == NULL)
|
||||
return -1;
|
||||
|
||||
|
||||
@@ -199,14 +199,12 @@ int kvm__get_sock_by_instance(const char *name)
|
||||
|
||||
int kvm__enumerate_instances(int (*callback)(const char *name, int fd))
|
||||
{
|
||||
char full_name[PATH_MAX];
|
||||
int sock;
|
||||
DIR *dir;
|
||||
struct dirent entry, *result;
|
||||
int ret = 0;
|
||||
|
||||
sprintf(full_name, "%s", kvm__get_dir());
|
||||
dir = opendir(full_name);
|
||||
dir = opendir(kvm__get_dir());
|
||||
if (!dir)
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user