# HG changeset patch # User Giacomo Lozito # Date 1187391815 -7200 # Node ID 47612fdac429f5199510532f4c55b30b9719a282 # Parent d0e39fd56c78788dce3fc73bb654dbf7a7a81403 Replaced asprintf with gstring (which is probably more portable anyway). diff -r d0e39fd56c78 -r 47612fdac429 src/wav/wav-sndfile.c --- a/src/wav/wav-sndfile.c Fri Aug 17 23:40:59 2007 +0100 +++ b/src/wav/wav-sndfile.c Sat Aug 18 01:03:35 2007 +0200 @@ -35,8 +35,6 @@ #include #include #include -#define _GNU_SOURCE -#include #include "audacious/plugin.h" #include "audacious/util.h" @@ -123,6 +121,7 @@ SNDFILE *tmp_sndfile; SF_INFO tmp_sfinfo; gchar *realfn = NULL, *codec = NULL, *format, *subformat = NULL; + GString *codec_gs = NULL; realfn = g_filename_from_uri(filename, NULL, NULL); tmp_sndfile = sf_open (realfn ? realfn : filename, SFM_READ, &tmp_sfinfo); @@ -271,13 +270,16 @@ case SF_FORMAT_DPCM_16: subformat = "16 bit differential PCM"; } -/* + + codec_gs = g_string_new(""); if (subformat != NULL) - asprintf(*codec, "%s (%s)", format, subformat); + g_string_append_printf(codec_gs, "%s (%s)", format, subformat); else - asprintf(*codec, "%s", format); -*/ - tuple_associate_string(ti, "codec", format); + g_string_append_printf(codec_gs, "%s", format); + codec = g_strdup(codec_gs->str); + g_string_free(codec_gs, TRUE); + + tuple_associate_string(ti, "codec", codec); } static gchar *get_title(char *filename)