Commit e6198a7023cf78ae5b7176f81dec78a105ea6a1a
1 parent
06177d36
Avoid the use of $ in format strings because it's system-specific - fixes drive …
…names under Win32 (Eduardo Felipe). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3846 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
2 deletions
vl.c
... | ... | @@ -5091,8 +5091,12 @@ static int drive_init(const char *str, int snapshot, QEMUMachine *machine) |
5091 | 5091 | |
5092 | 5092 | if (type == IF_IDE || type == IF_SCSI) |
5093 | 5093 | mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd"; |
5094 | - snprintf(buf, sizeof(buf), max_devs ? "%1$s%4$i%2$s%3$i" : "%s%s%i", | |
5095 | - devname, mediastr, unit_id, bus_id); | |
5094 | + if (max_devs) | |
5095 | + snprintf(buf, sizeof(buf), "%s%i%s%i", | |
5096 | + devname, bus_id, mediastr, unit_id); | |
5097 | + else | |
5098 | + snprintf(buf, sizeof(buf), "%s%s%i", | |
5099 | + devname, mediastr, unit_id); | |
5096 | 5100 | bdrv = bdrv_new(buf); |
5097 | 5101 | drives_table[nb_drives].bdrv = bdrv; |
5098 | 5102 | drives_table[nb_drives].type = type; | ... | ... |