mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
use g_path_get_dirname instead of dirname
Use g_path_get_basename to get the directory components of a file name, and free its return when no longer needed. Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com> Message-Id: <1459997185-15669-3-git-send-email-weijg.fnst@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6b92bbfe81
commit
55ad781ca7
2 changed files with 5 additions and 2 deletions
|
@ -299,9 +299,11 @@ void qemu_init_exec_dir(const char *argv0)
|
|||
return;
|
||||
}
|
||||
}
|
||||
dir = dirname(p);
|
||||
dir = g_path_get_dirname(p);
|
||||
|
||||
pstrcpy(exec_dir, sizeof(exec_dir), dir);
|
||||
|
||||
g_free(dir);
|
||||
}
|
||||
|
||||
char *qemu_get_exec_dir(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue