aboutsummaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorJulia Suvorova <jusual@mail.ru>2018-03-01 10:08:06 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2018-03-06 14:01:29 +0100
commit3e015d815b3f28bfd874bf8a1697308ef9af2b4c (patch)
treec9007e013761351acda3bbc000e36d192a180827 /qemu-io.c
parent4060e671c33679198d777558bf7c3750610e0f3d (diff)
downloadqemu-3e015d815b3f28bfd874bf8a1697308ef9af2b4c.zip
qemu-3e015d815b3f28bfd874bf8a1697308ef9af2b4c.tar.gz
qemu-3e015d815b3f28bfd874bf8a1697308ef9af2b4c.tar.bz2
use g_path_get_basename instead of basename
basename(3) and dirname(3) modify their argument and may return pointers to statically allocated memory which may be overwritten by subsequent calls. g_path_get_basename and g_path_get_dirname have no such issues, and therefore more preferable. Signed-off-by: Julia Suvorova <jusual@mail.ru> Message-Id: <1519888086-4207-1-git-send-email-jusual@mail.ru> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-io.c b/qemu-io.c
index 2c00ea0..160fb2a 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -504,7 +504,7 @@ int main(int argc, char **argv)
#endif
module_call_init(MODULE_INIT_TRACE);
- progname = basename(argv[0]);
+ progname = g_path_get_basename(argv[0]);
qemu_init_exec_dir(argv[0]);
qcrypto_init(&error_fatal);