From 1980155e34a75d1ca70c4b28104d9e10e7931a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laci=20b=C3=A1?= Date: Fri, 27 Aug 2021 09:02:31 +0200 Subject: [PATCH] Fix to avoid repurposing variables --- src/86box.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/86box.c b/src/86box.c index 3f5e897e0..155c5925a 100644 --- a/src/86box.c +++ b/src/86box.c @@ -564,15 +564,12 @@ usage: * At this point usr_path is perfectly initialized. * If no --vmname parameter specified we'll use the * working directory name as the VM's name. - * The directory name will stored in local buffer - * named `path` since it's unused in further parts - * of this function. */ if (strlen(vm_name) == 0) { - plat_get_dirname(path, usr_path); - p = plat_get_filename(path); - strcpy(vm_name, p); + char ltemp[1024] = {'/0'}; + plat_get_dirname(ltemp, usr_path); + strcpy(vm_name, plat_get_filename(ltemp)); } /*