util/FormatString: new library to replace g_strdup_printf()

This commit is contained in:
Max Kellermann
2013-10-19 16:58:45 +02:00
parent 1434e5a22e
commit 5dc4cbdf82
8 changed files with 151 additions and 66 deletions

View File

@@ -22,6 +22,7 @@
#include "DecoderAPI.hxx"
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "util/FormatString.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
@@ -122,9 +123,8 @@ gme_container_scan(const char *path_fs, const unsigned int tnum)
const char *subtune_suffix = uri_get_suffix(path_fs);
if (tnum <= num_songs){
char *subtune = g_strdup_printf(
SUBTUNE_PREFIX "%03u.%s", tnum, subtune_suffix);
return subtune;
return FormatNew(SUBTUNE_PREFIX "%03u.%s",
tnum, subtune_suffix);
} else
return nullptr;
}