aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 13:58:47 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 13:58:47 +0000
commite6198a7023cf78ae5b7176f81dec78a105ea6a1a (patch)
tree5ab1bd311afaf95021be3fe2ae16e520ad8350c5 /vl.c
parent06177d36ed948fe4d3d4dfb6b7a37d3d87ce6ed3 (diff)
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
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index e5b4e06cfe..52e6e66e76 100644
--- a/vl.c
+++ b/vl.c
@@ -5091,8 +5091,12 @@ static int drive_init(const char *str, int snapshot, QEMUMachine *machine)
if (type == IF_IDE || type == IF_SCSI)
mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd";
- snprintf(buf, sizeof(buf), max_devs ? "%1$s%4$i%2$s%3$i" : "%s%s%i",
- devname, mediastr, unit_id, bus_id);
+ if (max_devs)
+ snprintf(buf, sizeof(buf), "%s%i%s%i",
+ devname, bus_id, mediastr, unit_id);
+ else
+ snprintf(buf, sizeof(buf), "%s%s%i",
+ devname, mediastr, unit_id);
bdrv = bdrv_new(buf);
drives_table[nb_drives].bdrv = bdrv;
drives_table[nb_drives].type = type;