Skip to contentSkip to conversation

ui: Replace non-portable asprintf by g_strdup_printf

PATCH New Stefan Weil 1 participant 1 message Jan 16, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui: Replace non-portable asprintf by g_strdup_printf

---

This code is untested because I don't have a Mac available. Portability is unimportant here (it's only for cocoa), but I replaced asprintf nevertheless for the sake of uniformity of QEMU's code.

Regards,
Stefan Weil

 ui/cocoa.m |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
ui/cocoa.m +3 -3
index 3bf1c6e..754b95c 100644
@@ -813,9 +813,9 @@ QemuCocoaView *cocoaView;
 
         [sheet close];
 
-        asprintf(&argv[0], "%s", bin);
-        asprintf(&argv[1], "-hda");
-        asprintf(&argv[2], "%s", img);
+        argv[0] = g_strdup_printf("%s", bin);
+        argv[1] = g_strdup_printf("-hda");
+        argv[2] = g_strdup_printf("%s", img);
 
         printf("Using argc %d argv %s -hda %s\n", 3, bin, img);
 
Signature · 1 line
1.7.10.4