diff options
author | Max Kellermann <max@duempel.org> | 2013-10-19 17:15:17 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-19 17:15:17 +0200 |
commit | 1434e5a22e82b4176c24c536a91eefa183b78516 (patch) | |
tree | 64f2fa13494de041b1583c5c9d98d36f04447c7d /src/decoder/sidplay_decoder_plugin.cxx | |
parent | 9acc1e1e97ff75e681ef5527f512e57917c617f3 (diff) | |
download | mpd-1434e5a22e82b4176c24c536a91eefa183b78516.tar.gz mpd-1434e5a22e82b4176c24c536a91eefa183b78516.tar.xz mpd-1434e5a22e82b4176c24c536a91eefa183b78516.zip |
decoder/gme,input/curl,...: use static buffers instead of g_strdup_printf()
Diffstat (limited to 'src/decoder/sidplay_decoder_plugin.cxx')
-rw-r--r-- | src/decoder/sidplay_decoder_plugin.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/sidplay_decoder_plugin.cxx b/src/decoder/sidplay_decoder_plugin.cxx index 5123b493f..7d6ee91ac 100644 --- a/src/decoder/sidplay_decoder_plugin.cxx +++ b/src/decoder/sidplay_decoder_plugin.cxx @@ -359,11 +359,12 @@ sidplay_scan_file(const char *path_fs, title=""; if(info.songs>1) { - char *tag_title=g_strdup_printf("%s (%d/%d)", - title, song_num, info.songs); + char tag_title[1024]; + snprintf(tag_title, sizeof(tag_title), + "%s (%d/%d)", + title, song_num, info.songs); tag_handler_invoke_tag(handler, handler_ctx, TAG_TITLE, tag_title); - g_free(tag_title); } else tag_handler_invoke_tag(handler, handler_ctx, TAG_TITLE, title); @@ -373,9 +374,9 @@ sidplay_scan_file(const char *path_fs, info.infoString[1]); /* track */ - char *track=g_strdup_printf("%d", song_num); + char track[16]; + sprintf(track, "%d", song_num); tag_handler_invoke_tag(handler, handler_ctx, TAG_TRACK, track); - g_free(track); /* time */ int song_len=get_song_length(path_fs); |