Fix to avoid repurposing variables

This commit is contained in:
Laci bá
2021-08-27 09:02:31 +02:00
parent 2634909dbd
commit 1980155e34

View File

@@ -564,15 +564,12 @@ usage:
* At this point usr_path is perfectly initialized. * At this point usr_path is perfectly initialized.
* If no --vmname parameter specified we'll use the * If no --vmname parameter specified we'll use the
* working directory name as the VM's name. * 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) if (strlen(vm_name) == 0)
{ {
plat_get_dirname(path, usr_path); char ltemp[1024] = {'/0'};
p = plat_get_filename(path); plat_get_dirname(ltemp, usr_path);
strcpy(vm_name, p); strcpy(vm_name, plat_get_filename(ltemp));
} }
/* /*