diff options
author | Max Kellermann <max@duempel.org> | 2016-04-12 22:27:15 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-04-12 22:59:23 +0200 |
commit | 6a1f5667f95f99c4f4457f370abb10172fa7751e (patch) | |
tree | 4a35bbd04a4db80773ee81fe9cf0bb6989bd6439 /src/client | |
parent | fab5f58ee058ad7de633c26bb3fb90762bdeb6a9 (diff) |
util/FormatString: return AllocatedString
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientWrite.cxx | 5 | ||||
-rw-r--r-- | src/client/Response.cxx | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/client/ClientWrite.cxx b/src/client/ClientWrite.cxx index 6ceb7ab5b..f7a4b0363 100644 --- a/src/client/ClientWrite.cxx +++ b/src/client/ClientWrite.cxx @@ -20,6 +20,7 @@ #include "config.h" #include "Client.hxx" #include "util/FormatString.hxx" +#include "util/AllocatedString.hxx" #include <string.h> @@ -45,9 +46,7 @@ client_puts(Client &client, const char *s) void client_vprintf(Client &client, const char *fmt, va_list args) { - char *p = FormatNewV(fmt, args); - client.Write(p); - delete[] p; + client.Write(FormatStringV(fmt, args).c_str()); } void diff --git a/src/client/Response.cxx b/src/client/Response.cxx index b741d7eb5..62aca5ebb 100644 --- a/src/client/Response.cxx +++ b/src/client/Response.cxx @@ -21,6 +21,7 @@ #include "Response.hxx" #include "Client.hxx" #include "util/FormatString.hxx" +#include "util/AllocatedString.hxx" bool Response::Write(const void *data, size_t length) @@ -37,10 +38,7 @@ Response::Write(const char *data) bool Response::FormatV(const char *fmt, va_list args) { - char *p = FormatNewV(fmt, args); - bool success = Write(p); - delete[] p; - return success; + return Write(FormatStringV(fmt, args).c_str()); } bool |