Skip to contentSkip to conversation

audio: Replace non-portable asprintf in debug code by g_strdup_printf

PATCH Applied Stefan Weil 2 participants 2 messages Jan 16, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audio: Replace non-portable asprintf in debug code by g_strdup_printf

sw->name already uses the correct g_free to free the allocated memory.

---
 audio/audio.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

The patch preserves the special coding style used for audio code.

Regards,
Stefan

audio/audio.c +3 -2
index 1510b59..02bb886 100644
@@ -828,8 +828,9 @@ static int audio_attach_capture (HWVoiceOut *hw)
         QLIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
         QLIST_INSERT_HEAD (&hw->cap_head, sc, entries);
 #ifdef DEBUG_CAPTURE
-        asprintf (&sw->name, "for %p %d,%d,%d",
-                  hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
+        sw->name = g_strdup_printf ("for %p %d,%d,%d",
+                                    hw, sw->info.freq, sw->info.bits,
+                                    sw->info.nchannels);
         dolog ("Added %s active = %d\n", sw->name, sw->active);
 #endif
         if (sw->active) {
Signature · 1 line
1.7.10.4