util/FormatString: return AllocatedString

This commit is contained in:
Max Kellermann
2016-04-12 22:27:15 +02:00
parent fab5f58ee0
commit 6a1f5667f9
9 changed files with 68 additions and 71 deletions

View File

@@ -26,6 +26,7 @@
#include "fs/Path.hxx"
#include "fs/AllocatedPath.hxx"
#include "util/FormatString.hxx"
#include "util/AllocatedString.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
@@ -121,8 +122,8 @@ gme_container_scan(Path path_fs, const unsigned int tnum)
const char *subtune_suffix = uri_get_suffix(path_fs.c_str());
if (tnum <= num_songs){
return FormatNew(SUBTUNE_PREFIX "%03u.%s",
tnum, subtune_suffix);
return FormatString(SUBTUNE_PREFIX "%03u.%s",
tnum, subtune_suffix).Steal();
} else
return nullptr;
}

View File

@@ -24,6 +24,7 @@
#include "fs/Path.hxx"
#include "fs/AllocatedPath.hxx"
#include "util/FormatString.hxx"
#include "util/AllocatedString.hxx"
#include "util/Domain.hxx"
#include "util/Error.hxx"
#include "system/ByteOrder.hxx"
@@ -352,7 +353,7 @@ sidplay_container_scan(Path path_fs, const unsigned int tnum)
/* Construct container/tune path names, eg.
Delta.sid/tune_001.sid */
if(tnum<=info.songs) {
return FormatNew(SUBTUNE_PREFIX "%03u.sid", tnum);
return FormatString(SUBTUNE_PREFIX "%03u.sid", tnum).Steal();
} else
return nullptr;
}